/express-template

A RESTful, Node.js API template

Primary LanguageTypeScriptMIT LicenseMIT

Express Template

Node.js API template following MVC conventions.

By default, a User and Product objects are modeled. Basic CRUD endpoints are defined in /v1/products and /v1/users.

Installation

  1. Create repository from template.

  2. Install the dependencies:

    npm i
  3. Run the tests:

    npm test
  4. Start the server:

    npm start
  5. Generate build:

    npm build

Environment variables

  • MONGO_URI. Connection string to a MongoDB cluster.
  • SAMPLE_TOKEN. User token for testing.
  • SECRET. Used for generating and validating passwords.