Package Exports
- nodetomic-api-swagger
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (nodetomic-api-swagger) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Nodetomic-api-swagger

Simple and fast Restful API designed for horizontal scalability including cluster, based on Swagger, Nodejs, Redis + Passport, MongoDB, Express
Examples


Example horizontal scalability

Technologies
Requirements
Installation
git clone https://github.com/kevoj/nodetomic-api-swagger
cd nodetomic-api-swagger
npm i
Features
Tokens
- JWT merged with REDIS
Redis
- Expiration of Key by role time
- Encryption of information
- Synchronization with user model update
- Expiration and elimination event cleaner
Middleware
- Login validation
- Role validation
Authentication
- local
- github
- bitbucket
Session
- Single or Multiple
- Get list of sessions
- Destroy a session
Scalability
- Support for simple execution (nodemon/node)
- Support for cluster (Pm2)
Structure
- client
- src
- api
- controllers
- models
- swagger
- assets
- auth
- controllers
- passports
- swagger
- services
- config
- core
- lib
- seeds
- views
- app.js
- api
Development
Start
npm start
Build
npm run build
Generate output folder:
dist
- dist
- client
- server
- cluster.config.js (pm2 start cluster.config.js)
- simple.config.js (pm2 start simple.config.js)
- package.json
- npm start
- npm run pm2-simple
- npm run pm2-cluster
- dist
Test
npm test
You must be aware of running npm start
Lint
npm lint
Preview compiled in mode simple (pm2)
npm run pm2-dev-simple
Preview compiled in mode cluster (pm2)
npm run pm2-dev-cluster
Production
Run mode Default (node)
npm run serve
Run mode simple (pm2)
npm run pm2-simple
Run mode cluster (pm2)
npm run pm2-cluster
License
MIT © Leonardo Rico