Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vladimir-urik/devroomtodo
Part of my application to DevRoom
https://github.com/vladimir-urik/devroomtodo
Last synced: 7 days ago
JSON representation
Part of my application to DevRoom
- Host: GitHub
- URL: https://github.com/vladimir-urik/devroomtodo
- Owner: Vladimir-Urik
- Created: 2024-07-25T00:24:16.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2024-07-25T00:25:37.000Z (4 months ago)
- Last Synced: 2024-07-25T02:13:40.512Z (4 months ago)
- Language: Go
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# DevRoom TODO
- Part of my application to DevRoom## How to setup development environment
- Install golang (v1.22)
- Clone this repository
- Run "go mod tidy" to install dependencies
- Run "go run main.go" to start the server
- Server will be running on http://localhost:3332## How to run tests
- Run "go test ./tests/" to run all tests## How to use the API
> Base URL: http://localhost:3332### Endpoints
- GET /v1/todos
- Get all todos
- Response: 200 OK
- Response Body:
```json
[
{
"id": 1,
"title": "Create a todo list",
"description": "Create a todo list using golang"
}
]
```- POST /v1/todos
- Create a new todo
- Request Body:
```json
{
"title": "Create a todo list",
"description": "Create a todo list using golang"
}
```
- Response: 201 Created
- Response Body:
```json
{
"id": 1,
"title": "Create a todo list",
"description": "Create a todo list using golang"
}
```
- GET /v1/todos/:id
- Get a todo by id
- Response: 200 OK
- Response Body:
```json
{
"id": 1,
"title": "Create a todo list",
"description": "Create a todo list using golang"
}
```
- PUT /v1/todos/:id
- Update a todo by id
- Request Body:
```json
{
"title": "Create a todo list",
"description": "Create a todo list using golang"
}
```
- Response: 200 OK
- Response Body:
```
Todo updated
```
- DELETE /v1/todos/:id
- Delete a todo by id
- Response: 200 OK
- Response Body:
```
Todo deleted
```
## How to deploy
- Run "go build" to build the binary
- Run "./devroomtodo" to start the server
- Server will be running on http://0.0.0.0:3332## DISCLAIMER
All the responses shown here are valid only if you send a valid request like the one shown in the examples. If it is invalid the server will return a code 400 (Bad request)