simple-todo

command
v0.0.0-...-cb66316 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: MIT Imports: 12 Imported by: 0

README

Quickstart

Start the database via docker-compose

docker-compose up -d

build and run the server

Install swag go install github.com/swaggo/swag/cmd/swag@latest

go generate # generates swagger documentation
go build
./simple-todo

visit docs here: http://localhost:8080/docs/

Make some requests

curl -XPOST http://localhost:8080/todos -H 'Content-Type: application/json' -d '{"content": "todo1"}'

curl http://localhost:8080/todos

curl -XGET http://localhost:8080/todos/c1addf48-e20a-4dbd-932a-ce8def0aabc6 -H 'Content-Type: application/json'

curl -XDELETE http://localhost:8080/todos/dcd0c640-293a-41f7-b431-b5a4feb1f9fc -H 'Content-Type: application/json'


curl -XPUT http://localhost:8080/todos/c1addf48-e20a-4dbd-932a-ce8def0aabc6 -H 'Content-Type: application/json' -d '{"is_completed": true, "content": "todo1"}'

curl http://localhost:8080/todos?content=todo

curl http://localhost:8080/todos?content=random

curl http://localhost:8080/todos?is_completed=t

curl 'http://localhost:8080/todos?is_completed=t&content=1'

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package docs GENERATED BY SWAG; DO NOT EDIT This file was generated by swaggo/swag
Package docs GENERATED BY SWAG; DO NOT EDIT This file was generated by swaggo/swag

Jump to

Keyboard shortcuts

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