Skip to content

Starter for an ExpressJS powered Web API

License

Notifications You must be signed in to change notification settings

otmanecherradi/node-express-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Starter for an ExpressJS powered Web API

Prerequisites

  • Latest Node.js version.

Setup

Install dependencies:

npm i

Environment Config

Copy the .env.sample file into a file named .env and update the variables accordingly.

cp .env.sample .env

Also update the file named src/env.js with the variables accordingly.

Running

After installing dependencies, creating the .env file and updating the src/env.js file, run the API:

npm start

For development:

npm run dev

Description

Includes API Server utilities:

  • express
    • Fast, unopinionated, minimalist web framework for node.js
  • morgan
    • HTTP request logger middleware for node.js
  • helmet
    • Helmet helps you secure your Express apps by setting various HTTP headers. It's not a silver bullet, but it can help!
  • dotenv
    • Dotenv is a zero-dependency module that loads environment variables from a .env file into process.env
  • compression
    • Node.js compression middleware.
  • csurf
    • Node.js CSRF protection middleware.
  • cookie-parser
    • Parse Cookie header and populate req.cookies with an object keyed by the cookie names.
  • cors
    • CORS is a node.js package for providing a Connect/Express middleware that can be used to enable CORS with various options.

Development utilities:

  • nodemon
    • nodemon is a tool that helps develop node.js based applications by automatically restarting the node application when file changes in the directory are detected.
  • eslint
    • ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code.

Releases

No releases published

Packages

No packages published