Steps to run this project:
- Run
npm cicommand - Setup database settings inside
ormconfig.jsonfile - Database seed files inside
\seedfolder - Rolling log files inside
\logfolder - Configuration files inside
\configfolder - Run
npm run devcommand for live reload development
Docker build command -
docker build -t aunlead/nodejs-backend:1.0.0 .Docker run command -
docker run -p 29160:3000 -d --name testing-backend aunlead/nodejs-backend:1.0.0- To list all customers -
/api/v1/customers - To fetch specific customer details -
/api/v1/customers/:customer-id - To fetch all addresses of a specific customer -
/api/v1/customers/:customer-id/addresses
CREATE TABLE Customer (
Id INT PRIMARY KEY,
Name VARCHAR(50) NOT NULL,
Age INT NOT NULL,
Sex VARCHAR(6) NOT NULL
)CREATE TABLE Address (
Id INT PRIMARY KEY,
Address VARCHAR(500) NOT NULL,
CustomerId INT NOT NULL,
FOREIGN KEY (CustomerId)
REFERENCES Customer (id)
)Mock data from mockaroo