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, Socket.io, 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
- Pub/Sub Expired, del, etc by key
Middleware
- Login validation
- Role validation
Socket.io
- cluster
Authentication
- local
- github
- bitbucket
Session
- Single or Multiple (One or more devices at the same time)
- Get list of sessions
- Destroy a session
Scalability
- Support for simple execution
- Support for cluster
Structure
- client
- src
- api
- controllers
- models
- sockets
- 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
- simple.config.js
- package.json
- npm start
- npm run simple
- npm run cluster
- dist
Test
npm test
Lint
npm lint
Node [Production]
Default
Description: Run node in a single thread
npm run serve
PM2 [Development]
Simple
Description: Run pm2 in a single thread and run the monitor
npm run dev-simple
Cluster
Description: Run pm2 in multiple threads and run the monitor
npm run dev-cluster
PM2 [Production]
Simple
Description: Run pm2 in a single thread
npm run simple
Cluster
Description: Run pm2 in multiple threads
npm run cluster
Destroy
PM2
Description: destroyed pm2 simple and pm2 cluster
npm stop
Node
Description: destroyed all process for node
killall node
License
MIT © Leonardo Rico