todomvc

module
v0.0.0-...-ae36b9e Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2021 License: MIT

README

todomvc

Actions/Build Codecov Coveralls

This is a todomvc backend implementation in Go.

How to run

Requirements
  • Docker for Mac
  • docker-compose
  • Go 1.14 or later
  • Protobuf
Run server
# Setup commands like protoc
$ make setup

# Setup env vars. Specify 127.0.0.1 if you use Docker for Mac.
$ sed 's/<DOCKER_IP>/127.0.0.1/g' .env.sample > .env  

# Start MySQL and Jaeger
$ docker compose up -d

# Create tables
$ make db/goose/up

# Finally, start server
$ make restart

# Kill the server
$ make kill
Create new todo
$ curl -X POST -d '{"title":"My first task"}' http://127.0.0.1:5001/todos

{"id":"77b34605-8481-471a-9b92-266ec1f36486","title":"My first task"}
List todos
$ curl -X GET http://127.0.0.1:5001/todos

{"todos":[{"id":"77b34605-8481-471a-9b92-266ec1f36486","title":"My 1st task"}]}
Update todo
$ curl -X PATCH -d '{"todo":{"title":"My 2nd task"}}' http://127.0.0.1:5001/todos/<id>
Delete todo
$ curl -X DELETE http://127.0.0.1:5001/todos/<id>

Backend

CI

  • GitHub Actions

Directories

Path Synopsis
backend
controller/http
Copied from https://github.com/zenazn/goji/blob/master/web/mutil/writer_proxy_go1_8.go
Copied from https://github.com/zenazn/goji/blob/master/web/mutil/writer_proxy_go1_8.go
modeltest
modeltest provides functions to create database fixtures for unit test.
modeltest provides functions to create database fixtures for unit test.
proto-gen
tools module

Jump to

Keyboard shortcuts

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