This is a proof-of-concept (POC), multi-tenant RESTful Web Services application built on top of NodeJS.
- Install dependencies.
npm install
-
Verify the .env file having
PORT, TZ
and other variables. -
Verify the Database configuration in
config/config.json
. -
Like that
-
{
-
"development": {
-
"username": "root",
-
"password": null,
-
"database": "repairdesk",
-
"host": "127.0.0.1",
-
"dialect": "mysql",
-
"logging": false,
-
"pool": {
-
"max": 2,
-
"min": 1,
-
"acquire": 30000,
-
"idle": 10000
-
}
-
}
-
Start the application.
npm start
- Perform API requests.
-
For APIs
Authentication
, pass theJWT Token
in thecookie
header of the request. -
For APIs
Authorization
, pass theJWT Token
in theBearer
header of the request. -
Set the
server
in theJWT Token
.
server: <Will get Tenant ID>
- POST
/api/v1/customers
{
"status": "success",
"data": [
{
"cid": 1,
"first_name": "Ali husnain",
"last_name": "Warraich"
}
]
}
- Core - Express + Body Parser
- ORM - Sequelize + Sequelize CLI
- Databases - MySQL2 + SQLite3
- Logger - Winston + Morgan
- Monitoring - Nodemon