https://github.com/oiricaud/employee-crud-backend
This repository contains a simple boilerplate to send HTTP GET POST PUT requests for an Employee kind written in Nodejs Express
https://github.com/oiricaud/employee-crud-backend
backend-api employee employee-backend-api express nodejs
Last synced: 7 months ago
JSON representation
This repository contains a simple boilerplate to send HTTP GET POST PUT requests for an Employee kind written in Nodejs Express
- Host: GitHub
- URL: https://github.com/oiricaud/employee-crud-backend
- Owner: oiricaud
- Created: 2020-10-25T17:33:21.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-13T18:56:08.000Z (almost 5 years ago)
- Last Synced: 2025-01-17T18:04:09.948Z (9 months ago)
- Topics: backend-api, employee, employee-backend-api, express, nodejs
- Language: JavaScript
- Homepage:
- Size: 359 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Employee CRUD In NodeJS Express
## Build and run locally
```bash
npm install
npm start
```
Now go to `http://localhost:3000/api-docs` to view the swagger apiTo run the front end visit https://github.com/oiricaud/employee-crud-frontend and run it locally
## Expected Endpoints
POST http://localhost:3000/api/employees
```
curl -X POST "http://localhost:3000/api/employees" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"id\": 0, \"firstName\": \"Blkjob\", \"lastName\": \"Burgers\", \"hireDate\": \"01/01/2020\", \"role\": \"CEO\"}"
```PUT http://localhost:3000/api/employees/:id
```
curl -X PUT "http://localhost:3000/api/employees/1" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"id\": \"1\", \"firstName\": \"Lin\", \"lastName\": \"Layfield\", \"hireDate\": \"01/01/2020\", \"role\": \"CFO\"}"
```GET http://localhost:3000/api/employees/:id
```
curl -X GET "http://localhost:3000/api/employees/1" -H "accept: application/json"
```GET http://localhost:3000/api/employees
```
curl -X GET "http://localhost:3000/api/employees" -H "accept: application/json"
```DELETE http://localhost:3000/api/employees/:id
```
curl -X DELETE "http://localhost:3000/api/employees/1" -H "accept: application/json"
```