These are chat archives for FreeCodeCamp/Help

20th
Mar 2019
Christopher McCormack
@cmccormack
Mar 20 01:01
@sfisowelcome you should be able to get them automatically, make sure you claim the cert in your settings
zootechdrum
@zootechdrum
Mar 20 06:18
hello
Momozor
@momozor
Mar 20 11:37
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
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
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
@momozor are you trying to access the json you sent?
Niraj Nandish
@Nirajn2311
Mar 20 19:27
@cmccormack can you send an example of server.js file in the beginning of creation
Christopher McCormack
@cmccormack
Mar 20 19:27
no
Niraj Nandish
@Nirajn2311
Mar 20 19:27
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
@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
Yeah sorry about that 😂😂
one min let me get on pc
Kaz Baig
@kbaig
Mar 20 19:31
@cmccormack It's actually an hp ad
Christopher McCormack
@cmccormack
Mar 20 19:31
lol
Niraj Nandish
@Nirajn2311
Mar 20 19:32
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
gross
isn't really anything wrong with that code
Niraj Nandish
@Nirajn2311
Mar 20 19:34
ok thx
Christopher McCormack
@cmccormack
Mar 20 19:35
why not just use express.static?
Kaz Baig
@kbaig
Mar 20 19:36
Maybe doesn't need all the functionality?
Niraj Nandish
@Nirajn2311
Mar 20 19:36
Im kinda new to express
Christopher McCormack
@cmccormack
Mar 20 19:36
it's built in to express
he's using serve-static instead
but already importing express
Kaz Baig
@kbaig
Mar 20 19:36
...oh
I wasn't paying enough attention lol
Christopher McCormack
@cmccormack
Mar 20 19:37
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
This was a code i had copied from somewhere back when i was using it in Oct
Christopher McCormack
@cmccormack
Mar 20 19:38
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
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
:thumbsup:
Niraj Nandish
@Nirajn2311
Mar 20 19:39
Also im using heroku for deployment
Christopher McCormack
@cmccormack
Mar 20 19:39
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
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
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
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
: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
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
:thumbsup: imma stick with mongodb for now
Brad
@bradtaniguchi
Mar 20 21:14
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