Skip to content

A practical Node.js REST server (project template) to use by anyone around the world Topics Resources

License

Notifications You must be signed in to change notification settings

Parterdev/nodejs-rest-server

Repository files navigation

nodejs Node.js | REST Server Template

This project was created with Node.js v18.4.0 and JavaScript.

1. Description

This project is a new practical item of my Node.js app series that made with:

  • Node.js v18.4.0
  • express - (minimalist web framework to Node.js)
  • dotenv - (environment variables from .env file)
  • cors - (middleware package to enable CORS with many options)
  • 😎 Of course, I used things like controllers, models and routes to clean project structure.

¡Important code notes!

Options:
  - The main logic lives in the app.js (root file) with a single server instance.
  - The folder (routes) is used to store different kind of routes (you'll find users.js route example).
  - The folder (models) contains a server file with a class instance to generate middlewares, routes and listening port.
  - The folder (controllers) is used to serve CRUD (or more) special HTTP methods into the routes files (you'll find users.js controller example).
  - To install dependencies, run: $ npm install || $ yarn install
  - To watch js files changes, run: $ npm app.js -w || $ nodemon app.js 

2. Notice

  • Feel free to fork this repo and add your own twist!

About

A practical Node.js REST server (project template) to use by anyone around the world Topics Resources

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published