Loading README.md +18 −3 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ Installation * `cd $GOPATH/src` * `go get github.com/taironas/greentros` * `cd $GOPATH/src/github.com/greentros` * `go get` * `go get ./app-backend` * `export PORT=8080` Run App Loading @@ -35,13 +35,28 @@ Run App > pwd $GOPATH/src/github.com/taironas/greentros > greentros > app-backend 2014/11/19 22:23:57 Listening on 8080 Build ====== >cd $GOPATH/src/github.com/greentros >go get >go get ./app-backend Test locally ============= option 1: > app-backend 2014/12/07 00:35:02 Listening on 8080 option 2: If you have heroku install you should be able to run > foreman start 00:37:38 web.1 | started with pid 5762 00:37:38 web.1 | 2014/12/07 00:37:38 Listening on 8080 Deploy ======= Loading app-backend/main.go +2 −8 Original line number Diff line number Diff line Loading @@ -8,19 +8,13 @@ import ( "os" ) var root = flag.String("root", "app", "khkjh") //"$GOPATH/src/github.com/taironas/greentros/app", "file system path") var root = flag.String("root", "app", "file system path") func main() { //http.HandleFunc("/", hello) http.Handle("/", http.FileServer(http.Dir(*root))) //http.FileServer(http.Dir("static"))) log.Println("location on " + http.Dir(*root)) http.Handle("/", http.FileServer(http.Dir(*root))) log.Println("Listening on " + os.Getenv("PORT")) err := http.ListenAndServe(":"+os.Getenv("PORT"), nil) if err != nil { log.Fatal("ListenAndServe:", err) } } func hello(res http.ResponseWriter, req *http.Request) { fmt.Fprintln(res, "hello, greentros ngg") } Loading
README.md +18 −3 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ Installation * `cd $GOPATH/src` * `go get github.com/taironas/greentros` * `cd $GOPATH/src/github.com/greentros` * `go get` * `go get ./app-backend` * `export PORT=8080` Run App Loading @@ -35,13 +35,28 @@ Run App > pwd $GOPATH/src/github.com/taironas/greentros > greentros > app-backend 2014/11/19 22:23:57 Listening on 8080 Build ====== >cd $GOPATH/src/github.com/greentros >go get >go get ./app-backend Test locally ============= option 1: > app-backend 2014/12/07 00:35:02 Listening on 8080 option 2: If you have heroku install you should be able to run > foreman start 00:37:38 web.1 | started with pid 5762 00:37:38 web.1 | 2014/12/07 00:37:38 Listening on 8080 Deploy ======= Loading
app-backend/main.go +2 −8 Original line number Diff line number Diff line Loading @@ -8,19 +8,13 @@ import ( "os" ) var root = flag.String("root", "app", "khkjh") //"$GOPATH/src/github.com/taironas/greentros/app", "file system path") var root = flag.String("root", "app", "file system path") func main() { //http.HandleFunc("/", hello) http.Handle("/", http.FileServer(http.Dir(*root))) //http.FileServer(http.Dir("static"))) log.Println("location on " + http.Dir(*root)) http.Handle("/", http.FileServer(http.Dir(*root))) log.Println("Listening on " + os.Getenv("PORT")) err := http.ListenAndServe(":"+os.Getenv("PORT"), nil) if err != nil { log.Fatal("ListenAndServe:", err) } } func hello(res http.ResponseWriter, req *http.Request) { fmt.Fprintln(res, "hello, greentros ngg") }