Skip to content

ayostudio/api-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node API Starter ⚙️

Introduction

This is a great starter kit for any node.js API.

Getting Started

Requirements

  • node.js version > 8
  • mongodb running locally for the development server, or change the url for a remote server

Environment

The app configuration can be found in /app/config/index.js.

These environment variables have a default development configuration. They can be configured manually for production environments.

  • NODE_ENV - environment: development, staging, production
  • MONGODB_URI - mongodb connection uri: mongodb://{your-url}:27017/{db-name}
  • SECRET - used for authentication salts: {random-secure-string}
  • PORT - port the server will be run on: e.g. 2000

Usage

  • install dependencies: yarn
  • start development server: yarn start:dev
  • start production server: yarn start
  • run unit tests: yarn test:unit
  • run integration tests: yarn test:integration
  • run full test suite with coverage: yarn test

Features

  • Authentication with passport
  • Login and Signup endpoints
  • User model with one endpoint
  • Health check endpoint
  • Full test coverage using mocha, sinon and chai
  • Logger utility
  • Global error utility
  • Custom validation utility
  • Docblock comments

Coverage

Releases

No releases published

Packages

No packages published