Skip to content
Snippets Groups Projects
Commit 4289a0c3 authored by Aksel Baardsen's avatar Aksel Baardsen
Browse files

added port config for heroku deployment

parent 7ba9ca1d
No related branches found
No related tags found
No related merge requests found
...@@ -7,12 +7,14 @@ import ( ...@@ -7,12 +7,14 @@ import (
"github.com/gorilla/mux" "github.com/gorilla/mux"
"log" "log"
"net/http" "net/http"
"os"
) )
func main() { func main() {
r := mux.NewRouter() r := mux.NewRouter()
port := os.Getenv("PORT")
c := r.PathPrefix("/conservation/v1").Methods("GET").Subrouter() c := r.PathPrefix("/conservation/v1").Methods("GET").Subrouter()
// two handlerpaths makes sure that the caller does not HAVE to specify limit // two handlerpaths makes sure that the caller does not HAVE to specify limit
...@@ -30,7 +32,7 @@ func main() { ...@@ -30,7 +32,7 @@ func main() {
HandlerFunc(dHandler) HandlerFunc(dHandler)
http.Handle("/", r) http.Handle("/", r)
log.Fatal(http.ListenAndServe(":5000", nil)) log.Fatal(http.ListenAndServe(":"+port, nil))
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment