https://github.com/andream16/go-todo-list
Golang Todo List Backend
https://github.com/andream16/go-todo-list
go go-redis golang gorilla-mux redis rest-api
Last synced: 8 months ago
JSON representation
Golang Todo List Backend
- Host: GitHub
- URL: https://github.com/andream16/go-todo-list
- Owner: andream16
- Created: 2017-04-26T22:10:03.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-25T20:58:47.000Z (about 8 years ago)
- Last Synced: 2025-02-17T14:53:56.952Z (8 months ago)
- Topics: go, go-redis, golang, gorilla-mux, redis, rest-api
- Language: Go
- Size: 23.4 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go-Todo-List
A simple RESTful application built with [go](https://github.com/golang), [gorilla/mux](https://github.com/gorilla/mux) and [go-redis](https://github.com/go-redis/redis).
# What you need to run it
- [go1.8](https://golang.org/doc/devel/release.html#go1.8)
- [redis3.1](https://redis.io/download)
- [gorilla/mux](https://github.com/gorilla/mux). You can get it using `go get -u github.com/gorilla/mux` inside your `$GOPATH`
- [go-redis](https://github.com/go-redis/redis). You can get it using `go get -u github.com/go-redis/redis`# How to run it
- Start redis daemon `sudo service start redis` or `sudo systemctl start redis`
- run the main using `go run main/main.go` or build the project with `go build` and run it's bin# What you can Actually do
- Get all todos : `curl -H "Content-Type: application/json" -X GET http://localhost:8000`
- Get one todo : `curl -H "Content-Type: application/json" -X GET -d '{"id":"1"}' http://localhost:8000`
- Add a new todo: `curl -H "Content-Type: application/json" -X POST -d '{"content":"Have some Nugs"}' http://localhost:8000`
- Edit a todo : `curl -H "Content-Type: application/json" -X PUT -d '{"id":"1", "content":"New Content"}' http://localhost:8000`
- Delete a todo : `curl -H "Content-Type: application/json" -X DELETE -d '{"id":"1"}' http://localhost:8000`
Swagger reference available [here](https://app.swaggerhub.com/apis/AndreaM16/Go-Todo-List/1.0.0).
# Tests?
Sure thing. Run tests using `go test./...` to run all the tests in each folder. A test comes like `nameOfTheTest_test.go`.