Skip to content

Commit

Permalink
get url from env
Browse files Browse the repository at this point in the history
  • Loading branch information
Fs02 committed Jun 2, 2018
1 parent 88f8bb8 commit 74e5f14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.sample
@@ -1,4 +1,5 @@
PORT=3000
URL=http://localhost:3000/
MYSQL_USERNAME=root
MYSQL_PASSWORD=
MYSQL_HOST=localhost
Expand Down
3 changes: 2 additions & 1 deletion todo.go
Expand Up @@ -3,6 +3,7 @@ package main
import (
"encoding/json"
"fmt"
"os"

"github.com/Fs02/grimoire/changeset"
)
Expand Down Expand Up @@ -31,7 +32,7 @@ func (todo Todo) MarshalJSON() ([]byte, error) {
Title: todo.Title,
Order: todo.Order,
Completed: todo.Completed,
URL: fmt.Sprint("http://localhost:3000/", todo.ID),
URL: fmt.Sprint(os.Getenv("URL"), todo.ID),
})
}

Expand Down

0 comments on commit 74e5f14

Please sign in to comment.