command
module
Version:
v0.0.0-...-12f8c36
Opens a new window with list of versions in this module.
Published: Dec 19, 2023
License: MIT
Opens a new window with license information.
Imports: 14
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Go Todo Demo
A feature-incomplete, not-so-perfect, not-blazingly-fast and not-production-ready todo api I wrote while exploring some of the features in Go 😆
Running the app
-
With in-memory storage (map[int]string
😄)
go run .
-
With MongoDB docker container (refer docker-compose.yaml
)
docker compose up
go run . -m true
(Note: use Ctrl+C
to stop the app. And, if docker container was used, run docker compose down
to stop the container)
APIs
-
Note:
localhost:3000
is used as the host & port in the examples)
jq
is used in the examples to pretty-print json response
- use a trailing slash when sending the request using curl i.e.
/todo/
-
Add a Todo
curl -X POST localhost:3000/todo/ \
-H 'Content-Type: application/json' \
-d '{ "description": "test_description", "due": "9999-12-01 11:59:59PM" }' | jq .
-
Delete a Todo
curl localhost:3000 | jq .
-
Get a Todo
curl localhost:3000/todo/1 | jq .
-
Get All Todos
curl localhost:3000/todo/ | jq .
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.