

Delete the public folder #īecause we are building a REST API for quotes for this Node.js PostgreSQL tutorial we don’t need any CSS or JS.

The generated barebones Express Js app can be viewed in this pull request. You should see something similar on your browser when you hit on it:
Quick node tutorial install#
To quickly check if Express is setup correctly run the below: cd nodejs-posgresql & npm install & DEBUG =nodejs-posgresql:* npm start Your express will be set up when the command runs successfully. It will create the needed files in nodesj-postgresql directory. The other -git parameter indicates that we want to add the default.
Quick node tutorial generator#
The -no-view parameter tells the generator to generate the Express app without any view like Pug. To step Express js with express-generator run the following command: npx express-generator -no-view -git nodejs-postgresql So let’s start with setting up Express js: Setup Express with express generator # We will be using cURL to run the examples.Īt this juncture, we believe that your Node.js is running fine. It will be great to read about HTTP verbs and brush up on some cURL commands too. A quick refresher on what REST APIs are would be greatly helpful at this point. We will be building a very simple REST API with Express Js that can send out some quotes. I will be using VS Code as an editor but you are free to use any code editor of your choice for this Node.js PostgreSQL tutorial. If you want to use PostgreSQL locally you should try out Docker and PostgreSQL. Of course, you should know how a relational database works.
