Api Node.js

Sebastian Velez Zuluaga
1 min readJul 22, 2020

Create Resful API on Mac, with nodeJS

  1. Create folder where you can save your files.
  2. 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

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response