I am trying to put my app on Heroku. I am using angular on the front-end and Go on the backend.
I followed this tutorial http://mmcgrana.github.io/2012/09/getting-started-with-go-on-heroku.html
However, when I go to the domain of my heroku app, I get the directory of my app (everything in the git). When I navigate to the /app folder, (where my angular app lives) it shows the app.
I don't want my app to be at
foobar.herokuapp.com/app/#/
I want it to be at
foobar.herokuapp.com
A simplified version of my app directory is:
foobar
- /app
- /server/server.go
- .godir // contains "app"
- Procfile // contains "web: server"
I ran "go get" from inside my /server folder
These work:
$ PORT=5000 demoapp
$ curl -i http://127.0.0.1:5000/
Here is my simple server.go
package main
import (
"github.com/gorilla/handlers"
"log"
"net/http"
"os"
)
func main() {
log.Println("Starting Server")
http.Handle("/", logHandler(http.FileServer(http.Dir("../app/"))))
log.Println("Listening...")
panic(http.ListenAndServe(":"+os.Getenv("PORT"), nil))
}
func logHandler(h http.Handler) http.Handler {
return handlers.LoggingHandler(os.Stdout, h)
}