Created
January 3, 2017 11:51
-
-
Save sathishvj/1799782c443448784325138db2655dfd to your computer and use it in GitHub Desktop.
godo for go web server project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import do "gopkg.in/godo.v2" | |
func tasks(p *do.Project) { | |
// put your go path configuration as appropriate | |
// do.Env = `GOPATH=.vendor::$GOPATH` | |
// do.Env = `GOPATH=$GOPATH` | |
// do.Env = `GOPATH=/Users/me/projects/abcd/dev/gocode::/Users/me/go/gopath` | |
p.Task("default", do.S{"gobuild"}, nil) | |
p.Task("gobuild", do.S{}, func(c *do.Context) { | |
c.Run(`go build -o out`) | |
c.Start(`./out`) // my project is a web app. c.Start will stop listening server and restart it. | |
}).Src(`**/*.{go}`).Debounce(10000) | |
} | |
func main() { | |
do.Godo(tasks) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment