Skip to content

Commit

Permalink
added port
Browse files Browse the repository at this point in the history
  • Loading branch information
Fs02 committed Jun 2, 2018
1 parent e6e0e70 commit 88f8bb8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.sample
@@ -1,3 +1,4 @@
PORT=3000
MYSQL_USERNAME=root
MYSQL_PASSWORD=
MYSQL_HOST=localhost
Expand Down
4 changes: 3 additions & 1 deletion main.go
Expand Up @@ -21,6 +21,8 @@ func dsn() string {
}

func main() {
port := os.Getenv("PORT")

// initialize mysql adapter.
adapter, err := mysql.Open(dsn())
if err != nil {
Expand Down Expand Up @@ -52,5 +54,5 @@ func main() {
r.With(resource.Load).Delete("/{ID}", resource.Delete)
r.Delete("/", resource.Clear)

http.ListenAndServe(":3000", r)
http.ListenAndServe(":"+port, r)
}

0 comments on commit 88f8bb8

Please sign in to comment.