Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Aksel Baardsen
Assignment 1
Commits
4289a0c3
Commit
4289a0c3
authored
Oct 12, 2019
by
Aksel Baardsen
Browse files
added port config for heroku deployment
parent
7ba9ca1d
Changes
1
Hide whitespace changes
Inline
Side-by-side
main.go
View file @
4289a0c3
...
...
@@ -7,12 +7,14 @@ import (
"github.com/gorilla/mux"
"log"
"net/http"
"os"
)
func
main
()
{
r
:=
mux
.
NewRouter
()
port
:=
os
.
Getenv
(
"PORT"
)
c
:=
r
.
PathPrefix
(
"/conservation/v1"
)
.
Methods
(
"GET"
)
.
Subrouter
()
// two handlerpaths makes sure that the caller does not HAVE to specify limit
...
...
@@ -30,7 +32,7 @@ func main() {
HandlerFunc
(
dHandler
)
http
.
Handle
(
"/"
,
r
)
log
.
Fatal
(
http
.
ListenAndServe
(
":
5000"
,
nil
))
log
.
Fatal
(
http
.
ListenAndServe
(
":
"
+
port
,
nil
))
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment