https://github.com/bashbunni/testing-go-rest-api
Practicing writing unit tests for a Go REST API
https://github.com/bashbunni/testing-go-rest-api
Last synced: 11 months ago
JSON representation
Practicing writing unit tests for a Go REST API
- Host: GitHub
- URL: https://github.com/bashbunni/testing-go-rest-api
- Owner: bashbunni
- Created: 2022-01-07T04:14:14.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-07T06:06:11.000Z (over 4 years ago)
- Last Synced: 2025-02-18T19:50:03.322Z (over 1 year ago)
- Language: Go
- Size: 2.93 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## About
This repo is for practicing writing unit tests for REST APIs in Go.
I will pretend I'm doing API calls for an online chat as an example.
## Endpoints
GetAllMessages -> `/messages` -> GET all messages\
GetMessagesByUserID -> `/messages/:id` -> GET all messages for a given user\
NewMessage -> `/messages` -> POST new message\
DeleteMessage -> `/messages/:id` -> DELETE a message by ID\
\
GetAllUsers -> `/users` -> GET all users\
GetUserByID => `/users/:id` -> GET user by ID\
EditUser -> `/users/:id` -> PUT update user information by ID\