Skip to content

chiehwen/koa2-api-boilerplate

This branch is 7 commits behind adrianObel/koa2-api-boilerplate:master.

Folders and files

NameName
Last commit message
Last commit date
Apr 16, 2016
Apr 16, 2016
Apr 11, 2016
Apr 16, 2016
Mar 30, 2016
Feb 11, 2016
Mar 5, 2016
Mar 5, 2016
Feb 11, 2016
Mar 19, 2016
Apr 16, 2016
Apr 16, 2016

Repository files navigation

#koa2-api-boilerplate Boilerplate for building APIs with koa2 and mongodb.

This project covers basic necessities of most APIs.

  • Authentication (passport & jwt)
  • Database (mongoose)
  • Testing (mocha)
  • Doc generation with jsondoc

##Requirements

  • node ^4.0.0
  • npm ^3.0.0

##Installation

git clone https://github.com/adrianObel/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 jsondoc.

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

##License MIT

About

Boilerplate for building APIs with koa2.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%