godemo
godemo copied to clipboard
Go web application demo with gin-gonic
Go sample application
See Goに入門してRedis+PostgresなアプリをHerokuにデプロイするまで and APIドキュメントでAPIサーバをテストする
Usage
Install Vagrant, Ansible and Bower
$ git clone [email protected]:Leko/godemo.git
$ cd godemo
$ bower install
$ vagrant up --provision
$ vagrant ssh
$ vagrant@precise64:~$ cd go/src/godemo
$ vagrant@precise64:~/go/src/godemo$ go get
$ vagrant@precise64:~/go/src/godemo$ go get github.com/codegangsta/gin
$ vagrant@precise64:~/go/src/godemo$ gin -p 8080
Then open http://localhost:3000
Deploy
$ rm -rf .git
$ git init
$ git add .
$ git commit -m "initial commit"
$ heroku apps:create --addons heroku-postgresql:hobby-dev,rediscloud:30 --buildpack heroku/go
$ git push heroku master
$ # Wait a minutes
$ heroku open