https://github.com/bretheskevin/ynov-crud-webservices
https://github.com/bretheskevin/ynov-crud-webservices
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bretheskevin/ynov-crud-webservices
- Owner: bretheskevin
- Created: 2025-02-07T10:20:21.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-02-07T15:04:43.000Z (4 months ago)
- Last Synced: 2025-04-09T22:54:30.902Z (2 months ago)
- Language: TypeScript
- Size: 46.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Doctoloube
This project do not use any database, data is stored in memory. If you restart the server, all data will be lost.
Delete route is protected by authentication.
## Setup
````
cp .env.example .env
npm install
npm run start
````## Examples of commands
```
curl -X GET http://localhost:8080/v1/patients
curl -X GET http://localhost:8080/v1/patients/1
curl -X GET http://localhost:8080/v1/patients/abc
curl -X GET http://localhost:8080/v1/patients/999curl -X POST http://localhost:8080/v1/patients -H "Content-Type: application/json" -d '{"fullname": "John Doe"}'
curl -X POST http://localhost:8080/v1/patients -H "Content-Type: application/json" -d '{}'
curl -X POST http://localhost:8080/v1/patients -H "Content-Type: application/json" -d '{"fullname": "John Doe",}'
curl -X PUT http://localhost:8080/v1/patients/1 -H "Content-Type: application/json" -d '{"fullname": "Jane Doe"}'curl -X PUT http://localhost:8080/v1/patients/1 -H "Content-Type: application/json" -d '{}'
curl -X DELETE http://localhost:8080/v1/patients/1
curl -X DELETE http://localhost:8080/v1/patients/1 -H "Authorization: "
```## Authentication
```
curl -X POST http://localhost:8080/v1/auth/register -H "Content-Type: application/json" -d '{"username": "John Doe", "password": "password"}'
curl -X POST http://localhost:8080/v1/auth/login -H "Content-Type: application/json" -d '{"username": "John Doe", "password": "password"}'
```