RESTful API for simple todo application written in Go.
├── app
│ ├── app.go
│ ├── handlers
│ │ ├── common.go
│ │ └── tasks.go
│ └── models
│ ├── sql
│ │ └── init.sql
│ ├── db.gp
│ └── todo.go
├── config
│ └── config.go
└── main.go
docker-compose up
Server should be running on localhost:8000
, with hot reloading on.
Download this project
go get github.com/mjelonek92/go-todo-app
cd $GOPATH/src/github.com/mjelonek92/go-todo-app
Install requirements using glide
glide install
Create user and database
psql -c "CREATE USER tododb WITH PASSWORD 'tododb'"
psql -c "ALTER USER tododb CREATEDB"
psql -c "CREATE DATABASE tododb WITH OWNER tododb"
Run SQL to create tables and relations.
psql -Utododb -dtododb -h127.0.0.1 -f app/models/sql/*
Build and run
go build
./go-todo-app
Server should be running on localhost:8000
.