https://github.com/samayun/restapi-hiredis-cplusplus
A restful api service built by C++.
https://github.com/samayun/restapi-hiredis-cplusplus
cplusplus hiredis restapi-cplusplus
Last synced: 10 months ago
JSON representation
A restful api service built by C++.
- Host: GitHub
- URL: https://github.com/samayun/restapi-hiredis-cplusplus
- Owner: samayun
- Created: 2023-05-25T19:37:56.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-06-16T05:21:28.000Z (over 2 years ago)
- Last Synced: 2025-01-10T23:34:46.479Z (12 months ago)
- Topics: cplusplus, hiredis, restapi-cplusplus
- Language: C++
- Homepage: https://github.com/samayun/restapi-hiredis-cplusplus/blob/master/CPP-restApi_Hiredis.pdf
- Size: 870 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### CPP rest sdk Hiredis Restful Api by C++
### Pre requirement
- OS - Linux preferd
- Docker
- Docker Compose
### Before run cpp file install docker & docker-compose must
- [Installation Docker & Docker Compose](https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/How-to-install-Docker-and-docker-compose-on-Ubuntu)
### Installation and Commands
```bash
// Build container and run redis on local pc
sudo make build
// run the c++ program
bash run.sh
```


## CRUD using Terminal (Curl)

## Database Dashboard

### CREATE USER
```sh
curl -X POST -H "Content-Type: application/json" -d '{"id":"1", "name":"John", "age":"30"}' http://localhost:8080/users
```
### GET USER
```sh
curl http://localhost:8080/users/1
```
### UPDATE
```sh
curl -X PUT -H "Content-Type: application/json" -d '{"name":"John Doe", "age":"35"}' http://localhost:8080/users/1
```
### UPDATE
Delete a user (DELETE):
```sh
curl -X DELETE http://localhost:8080/users/1
```