A simple RESTful API (CRUD) built with GoLang
Clone and setup:
$ git clone https://github.com/wilk/backend-api-go.git
$ cd backend-api-go
$ ./setup.sh
First, setup docker-compose:
$ docker-compose up
Then start querying at http://localhost:3000/api/users/
$ docker-compose down
The entity User has the following fields:
- ID (uint)
- name (string)
- email (string)
- age (int)
- mobile (string)
Follows the list of users APIs:
METHOD | URL | REQUEST HEADERS | REQUEST PAYLOAD | RESPONSE HEADERS | RESPONSE PAYLOAD |
---|---|---|---|---|---|
GET | http://localhost:3000/api/users/ | User[] | |||
POST | http://localhost:3000/api/users/ | Content-Type: "application/json" | User | User | |
GET | http://localhost:3000/api/users/10 | User | |||
PUT | http://localhost:3000/api/users/10 | Content-Type: "application/json" | User | User | |
DELETE | http://localhost:3000/api/users/10 |