|
|
|
|
@ -1,6 +1,7 @@
@@ -1,6 +1,7 @@
|
|
|
|
|
package main |
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
|
"flag" |
|
|
|
|
"github.com/joho/godotenv" |
|
|
|
|
"html/template" |
|
|
|
|
"net/http" |
|
|
|
|
@ -11,11 +12,16 @@ import (
@@ -11,11 +12,16 @@ import (
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
func main() { |
|
|
|
|
err := godotenv.Load() |
|
|
|
|
if err != nil { |
|
|
|
|
devMode := flag.Bool("dev", false, "load .env (local dev)") |
|
|
|
|
flag.Parse() |
|
|
|
|
|
|
|
|
|
if *devMode { |
|
|
|
|
if err := godotenv.Load(); err != nil { |
|
|
|
|
panic("failed to load .env") |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// set up JWT secret used for authentication
|
|
|
|
|
auth.JwtSecret = []byte(os.Getenv("JWT_SECRET")) |
|
|
|
|
tmpl := template.Must(template.ParseGlob("static/*.html")) |
|
|
|
|
|