Used in this project:
- Node.js
- express
- mssql
- sequelize
- tedious
- cors
Go to the project directory
cd api-node-mssql
Install dependencies
npm install
Start the server
npm run start
To run this project, you will need to set values for variables in config.json
dbName
- Database name, that will be created
server
- Server connection address
userName
- Username
password
- Password
GET /ping
Response: Dogshouseservice.Version1.0.1
GET /dogs
filter | Description |
---|---|
attribute |
Filter by any attribute: name, color, tail_length, weight |
order |
Order items by asc or desc |
pageNumber |
By default pageNumber is 1 |
pageSize |
By default pageSize is 10 |
Example
GET /dogs?attribute=name&order=desc&pageNumber=1&pageSize=2
POST /dog
Payload
{
name: string;
color: string;
tail_length: number;
weight: number;
}