2018-03-24 10:26:25 -07:00
2018-03-24 10:25:12 -07:00
2018-03-05 19:38:29 -08:00
2016-02-11 14:28:00 -05:00
2018-03-05 19:38:29 -08:00
2016-03-04 20:51:37 -05:00
2018-03-02 18:50:12 -08:00
2018-03-24 10:26:25 -07:00
2018-03-05 19:38:29 -08:00
2018-03-05 19:43:00 -08:00

babel-free-koa2-api-boilerplate

js-standard-style

Boilerplate for building APIs with koa2 and mongodb. Modified to remove babel as a dependency. This repository is now natively compatible with node v8.9 or higher.

With the exception of removing babel as a dependency, this repository is identical to Adrian Obelmejias' koa-api-boilerplate repository.

This project covers basic necessities of most APIs.

  • Authentication (passport & jwt)
  • Database (mongoose)
  • Testing (mocha)
  • Doc generation with apidoc
  • linting using standard

Requirements

  • node ^8.9.4
  • npm ^5.7.1

Installation

git clone https://github.com/christroutner/babel-free-koa2-api-boilerplate.git

Features

Structure

├── bin
│   └── server.js            # Bootstrapping and entry point
├── config                   # Server configuration settings
│   ├── env                  # Environment specific config
│   │   ├── common.js
│   │   ├── development.js
│   │   ├── production.js
│   │   └── test.js
│   ├── index.js             # Config entrypoint - exports config according to envionrment and commons
│   └── passport.js          # Passportjs config of strategies
├── src                      # Source code
│   ├── modules
│   │   ├── controller.js    # Module-specific controllers
│   │   └── router.js        # Router definitions for module
│   ├── models               # Mongoose models
│   └── middleware           # Custom middleware
│       └── validators       # Validation middleware
└── test                     # Unit tests

Usage

  • npm start Start server on live mode
  • npm run dev Start server on dev mode with nodemon
  • npm run docs Generate API documentation
  • npm test Run mocha tests

Documentation

API documentation is written inline and generated by apidoc.

Visit http://localhost:5000/docs/ to view docs

License

MIT

Languages
JavaScript 97.6%
Dockerfile 1.2%
Shell 0.7%
HTML 0.5%