daolis / todo-api

Simple go api example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

todo-api example

Simple web api to create, get todos, get the list of todos, and set them to done.

If you run it locally with...

go run .

... you can access the api at localhost:8080

Endpoints

For a detailed API description see api-spec.yaml

Get all ToDo items

Request:

GET http://localhost:8080/api/toDoItems

Add a new ToDo item

Request:

POST http://localhost:8080/api/toDoItems

Content-Type: text/plain

Get a single ToDo item

GET http://localhost:8080/api/toDoItems/MXdzY2yO5rnZoZeg

Set ToDo item to done

POST http://localhost:8080/api/toDoItems/MXdzY2yO5rnZoZeg/setDone

Start with docker

docker run -it --rm -p8090:8080 daolis/todo-api:latest

Then you can access the api at localhost:8090/

About

Simple go api example


Languages

Language:Go 97.6%Language:Dockerfile 2.4%