P2P VPS API server based on Node.js and Koa
Switch branches/tags
Nothing to show
Clone or download
christroutner Merge pull request #63 from P2PVPS/unstable
Merging prorate prototype into master
Latest commit 03634ed Aug 16, 2018

README.md

P2P VPS Server (v2)

Build Status

Coverage Status

This is the second incarnation of the P2P VPS server. Whereas the first repository focused on proof-of-concept, this second version focuses on Test Driven Development (TDD). Every API is fully tested as it is developed. This makes the software much more reliable and makes the open source project much more manageable.

This new version of the server was based on this Koa Boilerplate project.

Installation

git clone https://github.com/P2PVPS/p2pvps-server2
npm install
./install-mongo
npm run test
npm start

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