Open utterances-bot opened 3 years ago
Thanks for this tutorial, cleared many things for me!!
How would you type this command on windows cat init.sql | heroku pg:psql postgresql-whatever-00000 --app example-node-api
? am I missing something? thanks
@VincenzoMarcovecchio - Windows doesn't have the cat command... you could try "type": https://superuser.com/questions/434870/what-is-the-windows-equivalent-of-the-unix-command-cat
However, Tania is using MacOS in this tutorial, so I wouldn't be surprised if you come across other differences in trying to make it work natively on Windows. You might want to consider installing WSL for Windows and running Ubuntu to make the commands more similar, but either way you'll probably need to research some OS specifics.
Hi Tania, the app on localhost works fine but on heroku I get an error when opening the app. In heroku in Config Vars I wrote NODE_ENV: production PORT: 5432. But it doesn't work
Hey @raulavilesrodriguez I fixed this problem by setting the server to be listening to process.env.PORT
when in production, it's an heroku thing that should fix it
@raulavilesrodriguez change ssl: isProduction to ssl: { rejectUnauthorized: false }
Thank you so much for this amazing tutorial!
One update since it was written: body-parser got added back to express.
I got a deprecated error in VSCode so this is what I needed to do
bodyParser.json()
bodyParser.urlencoded(...)
use express
express.json()
express.urlencoded(...)
Thanks @JorgenNyborgChristensen ssl: { rejectUnauthorized: false } This definitely worked for me.
The frontend isn't working it is saying await only works in async functions can anyone help me?
@PugmanD are you writing async
before the function name?
Ie:
async myFunc(){}
Thanks for this Tania, you are amazing! Just a question, what do you think about using Sequelize instead of node-postgres?
Glad you liked it, @AndresSalomon1990. I don't have an opinion on Sequelize since I've never used it.
Thank you for this Tania! I used this to extend an app I started by following your excellent MVC tutorial!
Can anyone point me to a resource on how to properly display error messages on the client side that are returned from express-validator when attempting to insert into the database via the fetch api?
Build a Node.js, Express, & PostgreSQL REST API | Tania Rascia
Recently, I wanted to create and host a Node server, and discovered that Heroku is an excellent cloud platform service that has free hobby…
https://www.taniarascia.com/node-express-postgresql-heroku/