These are chat archives for FreeCodeCamp/Help

20th
Mar 2019
Christopher McCormack
@cmccormack
Mar 20 01:01 UTC
@sfisowelcome you should be able to get them automatically, make sure you claim the cert in your settings
zootechdrum
@zootechdrum
Mar 20 06:18 UTC
hello
Momozor
@momozor
Mar 20 11:37 UTC
hi
I finally deployed my url shortener microservice app after 15 hours debugging through docker and heroku :cry: :cry: :laughing:
zootechdrum
@zootechdrum
Mar 20 18:29 UTC
hello
how can i create multiple rotating rectangles in paper.js
here is what I have so far.
    // Gets a random point according to the screen size.
    function onKeyDown(event) {
        var maxPoint = new Point(view.size.width, view.size.height);
        var randomPoint = Point.random();
        var point = maxPoint * randomPoint;
        console.log(point)

        // Create a rectangle shaped path with its top left point at
         var path = new Path.Rectangle({
            point: [point.x, point.y],
            size: [75, 75],
            strokeColor: 'pink',
            strokeWidth:7,

        });


    }
    function onFrame(event) {
        path.rotate(3)
    }
Momozor
@momozor
Mar 20 18:35 UTC
Hmm..how can I use JSON data from fetch error response which the server returns JSON
Only throwing exception works...I don't know how to access the JSON data
enter an invalid HTTP url, and see the console
Christopher McCormack
@cmccormack
Mar 20 19:04 UTC
@momozor are you trying to access the json you sent?
Niraj Nandish
@Nirajn2311
Mar 20 19:27 UTC
@cmccormack can you send an example of server.js file in the beginning of creation
Christopher McCormack
@cmccormack
Mar 20 19:27 UTC
no
Niraj Nandish
@Nirajn2311
Mar 20 19:27 UTC
IMG_5061.jpeg
Here was one i had used
the thing is i get confused with the tutorials as many of them have variations
so wanted to check if mine was perfect
Christopher McCormack
@cmccormack
Mar 20 19:28 UTC
@Nirajn2311 never heard of the prt scrn button?
or the built in snippet tool?
you can use snippet to grab a selection, copy it and paste directly into gitter
Niraj Nandish
@Nirajn2311
Mar 20 19:29 UTC
Yeah sorry about that 😂😂
one min let me get on pc
Kaz Baig
@kbaig
Mar 20 19:31 UTC
@cmccormack It's actually an hp ad
Christopher McCormack
@cmccormack
Mar 20 19:31 UTC
lol
Niraj Nandish
@Nirajn2311
Mar 20 19:32 UTC
const express = require('express');
const serveStatic = require('serve-static');
const path = require('path');
const app = express();
app.use(serveStatic(path.join(__dirname, 'dist')));
const port = process.env.PORT || 80;
app.listen(port);
@kbaig then HP's in for a loss, coz this one has 4gb ram :laughing:
Kaz Baig
@kbaig
Mar 20 19:33 UTC
gross
isn't really anything wrong with that code
Niraj Nandish
@Nirajn2311
Mar 20 19:34 UTC
ok thx
Christopher McCormack
@cmccormack
Mar 20 19:35 UTC
why not just use express.static?
Kaz Baig
@kbaig
Mar 20 19:36 UTC
Maybe doesn't need all the functionality?
Niraj Nandish
@Nirajn2311
Mar 20 19:36 UTC
Im kinda new to express
Christopher McCormack
@cmccormack
Mar 20 19:36 UTC
it's built in to express
he's using serve-static instead
but already importing express
Kaz Baig
@kbaig
Mar 20 19:36 UTC
...oh
I wasn't paying enough attention lol
Christopher McCormack
@cmccormack
Mar 20 19:37 UTC
lol I mean serve-static is probably fine, just curious
@Nirajn2311 probably don't want to use port 80
Niraj Nandish
@Nirajn2311
Mar 20 19:38 UTC
This was a code i had copied from somewhere back when i was using it in Oct
Christopher McCormack
@cmccormack
Mar 20 19:38 UTC
my understanding is your server would normally be behind a reverse-proxy or something where the web server would redirect the request to your service
Niraj Nandish
@Nirajn2311
Mar 20 19:39 UTC
Now i was gonna do something else and so i wanted to check if the code was right
Christopher McCormack
@cmccormack
Mar 20 19:39 UTC
:thumbsup:
Niraj Nandish
@Nirajn2311
Mar 20 19:39 UTC
Also im using heroku for deployment
Christopher McCormack
@cmccormack
Mar 20 19:39 UTC
ah heroku probably populates the PORT env variable I imagine
@Nirajn2311 I made this hoping I would actually keep it up to date, might be useful https://github.com/cmccormack/react-nodejs-boilerplate
at least the server stuff
Niraj Nandish
@Nirajn2311
Mar 20 19:42 UTC
Nice and also Im using Vue :laughing:
ignore the react stuff
I have another React boilerplate that I actually am trying to keep up to date
Niraj Nandish
@Nirajn2311
Mar 20 19:46 UTC
Just need a feedback on this
So I have been mainly working with designing till now, and so i thought of making a recipe site which puts all recipes in the form of a table and if you click on any of the recipes it pops up.
So express is for the server,right?
and which database is better firebase or mongodb?
Christopher McCormack
@cmccormack
Mar 20 19:56 UTC
yeah express is the server/middleware
up to you on the db
whatever floats your boat as they say :)
Niraj Nandish
@Nirajn2311
Mar 20 19:58 UTC
:thumbsup:
@cmccormack In highschool they taught me mysql, and i havent worked with this side, so which is like easier to learn
Christopher McCormack
@cmccormack
Mar 20 20:00 UTC
firebase seems really easy, although I have only reviewed the docs, never implemented
I've done several with mongodb
only used sql in university
Niraj Nandish
@Nirajn2311
Mar 20 20:07 UTC
:thumbsup: imma stick with mongodb for now
Brad
@bradtaniguchi
Mar 20 21:14 UTC
firebase has a lot of shortcomings (talking about firestore, not RTDB). Queries suck, sorting is limited, there basically is no search support
firebase's firestore DB is more like a limited API backend than an actual full DB. Unless you can warp your requirements around firestore's shortcomings, your better off sticking with a full DB solution like Mongo, or an SQL DB. @Nirajn2311