go-todo-list-example

command module
v0.0.0-...-bed1600 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2019 License: MIT Imports: 2 Imported by: 0

README

go-todo-list-example

An example project to create your own todo list written in Go.

It supports:

  • Adding notes (POST)
  • Listing notes (GET)
  • Listing a specific note (GET)
  • Completing notes (PUT)
  • Deleting specifing note (DELETE)

Run the application:

$ go run main.go

Add a note to the todo list (POST):

$ curl localhost:3000/todo -d '{"message": "I still have to cook dinner."}'
{"id":"blcnvkkllhcm5r8n5ctg"}

List notes (GET):

$ curl localhost:3000/todo
[{"id":"blcnvkkllhcm5r8n5ctg","message":"I still have to cook dinner.","complete":false}]

List a specific note (GET) (based on ID):

$ curl localhost:3000/todo/blcnvkkllhcm5r8n5ctg
{"id":"blcnvkkllhcm5r8n5ctg","message":"I still have to cook dinner.","complete":false}

Complete note (PUT):

$ curl -X PUT -H "Content-Type: application/json" -d '{"id":"blcnvkkllhcm5r8n5ctg"}' localhost:3000/todo

Delete a specific note (DELETE) (based on ID):

$ curl -X DELETE localhost:3000/todo/blcnvkkllhcm5r8n5ctg

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL