Skip to content

Node.js API server/backend build with Express.js, GitHub Actions build, babel, minimal tooling (nodemon, standard), and mocha tests. Can be used as a template to quickly bootstrap yor Node.js server projects.

License

mihaur/node-express-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js API server based on express project template

js-standard-style Conventional Commits Greenkeeper badge GitHub Actions CI Coverage Status

Node.js API server/backend build with Express.js, GitHub Actions build, babel, minimal tooling (nodemon, standard), and mocha tests. Can be used as a template to quickly bootstrap yor Node.js server projects.

All features

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Installing

  • git clone git@github.com:mihaur/node-server-template.git
  • cd cd node-server-template
  • cp .env.sample .env
  • npm install
  • npm start

Configuring

Use .env to store your environment dependant configuration options and secrets. This file should not be checked in to your repository, use .env.sample as example but exclude real secrets.

Building

To run the build use npm run build. Build artifacts along source maps are stored in dist folder.

Debugging built code

To debug build code run npm run debug.

Then you can attach your IDE or Chrome DevTools to a running process by appending WebSocket UUID printed to console to chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=localhost:9229/ . See Node.js documentation for details.

Linting and code fixing

Linting is done using standard. Use npm run lint to run linter. Linter output is piped trough snazzy which converts "compact" text from a linter to "stylish". You can also automatically fix linter errors by running npm run lint:fix.

Testing

Tests can be run by mocha. Run npm run test to run both unit and integration tests.

Unit tests

Unit tests are stored in src/**.spec.js.

Integration tests

Integration tests are stored in test/**.spec.js.

Coverage tests

Run npm run coverage to generate test coverage report. Both unit and integration tests are run. Report is generated in coverage/ directory using HTML and lcov formatters. Use npx serve coverage to serve generated HTML.

Documentation

Run npm run doc to create HTML documentation from JSDoc annotations. Documentation is stored in doc/ directory. Use npx serve coverage to serve generated documentation.

About

Node.js API server/backend build with Express.js, GitHub Actions build, babel, minimal tooling (nodemon, standard), and mocha tests. Can be used as a template to quickly bootstrap yor Node.js server projects.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •