mirror of
https://github.com/Permissionless-Software-Foundation/bch-dex.git
synced 2026-09-22 01:02:00 -07:00
97d49753db04d3aceda1a01ae48fa21f58e48f57
babel-free-koa2-api-boilerplate
Boilerplate for building APIs with koa2 and mongodb. This repository is based on Adrian Obelmejias' koa-api-boilerplate repository. It makes the following modifications:
-
Remove babel as a dependency. This repository is now natively compatible with node v8.9 or higher.
-
Replaced
bcryptdependency withbcryptjs. This improves compatibility across versions of node.js and across OSs.
Features
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
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 startStart server on live modenpm run devStart server on dev mode with nodemonnpm run docsGenerate API documentationnpm testRun mocha tests
Documentation
API documentation is written inline and generated by apidoc.
Visit http://localhost:5000/docs/ to view docs
Dependencies
- koa2
- koa-router
- koa-bodyparser
- koa-generic-session
- koa-logger
- MongoDB
- Mongoose
- Passport
- Nodemon
- Mocha
- apidoc
- ESLint
License
MIT
Description
GitHub mirror of https://github.com/Permissionless-Software-Foundation/bch-dex.git
9.9 MiB
Languages
JavaScript
97.6%
Dockerfile
1.2%
Shell
0.7%
HTML
0.5%