
Api Node.js
Create Resful API on Mac, with nodeJS
- Create folder where you can save your files.
- Open terminal and create the initial config for git.
git init
3. Create the .gitignore file
3. Create the project with nodeJs
npm init
4. Install eslint and init
npm install eslint — save-dev
npx eslint — init
5. install express
npm i -S express
6. Create the app.js
7. Create the index.js
8. Installa depencies for express
npm i -S compression body-parser method-override errorhandler
9. Create express.js
10. Create folder test with two files, controller is the file to control the bd querys and index will control the PUT, GET, DELETE, POST
11. Create the route file
The repo with the files and code:
https://github.com/sebastianvz/Template-NodeJS-Api
For better information follow the original version. https://medellin-js.gitbook.io/workshop-fullstack-js-developer/backend/express-js