https://github.com/aintnodev/pairs
Fast RESTful API written with go and gin
https://github.com/aintnodev/pairs
go restapi
Last synced: 10 months ago
JSON representation
Fast RESTful API written with go and gin
- Host: GitHub
- URL: https://github.com/aintnodev/pairs
- Owner: aintnodev
- Created: 2025-03-23T14:58:54.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-03-23T15:01:20.000Z (10 months ago)
- Last Synced: 2025-03-23T16:19:19.689Z (10 months ago)
- Topics: go, restapi
- Language: Go
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pair-api: wtf i build this?
## Installation
```sh
# check if go is installed
go -v
```
```sh
# clone repo locally
git clone https://github.com/aintnodev/pairs.git
cd pairs
# install project dependencies
go mod tidy
# compile and run go program
go run .
```
## Usage
```sh
# to get first 10 items in descending order [defalut]
http :3000/api/get
# to get top "n" number of responses
http :3000/api/get?limit={n}
# to search `aname` or `bname` in database
http :3000/api/get?query={query}
# to get item in ascending order
http :3000/api/get?order={asc}
# to get item in descending order
http :3000/api/get?order={desc}
# to get first 3 items in descending order
http :3000/api/get?limit=3&order=desc
# to add an item with values "aintnodev" and "stelafella"
http :3000/api/add aname="aintnodev" bname="stelafella"
# to delete a value with id "id"
http DELETE :3000/api/delete/{id}
```