Basic API structure

This commit is contained in:
Daniel Mason 2021-03-25 18:15:01 +13:00
parent 28d8d3491a
commit 529ac7ab84
9 changed files with 118 additions and 16 deletions

View file

@ -1,10 +1,22 @@
package main
import (
"log"
"os"
"git.m2.nz/go-scrobble/internal/goscrobble"
"github.com/joho/godotenv"
)
func main() {
err := godotenv.Load()
if err != nil {
log.Fatal("Error loading .env file")
}
// Store JWT secret
goscrobble.JwtToken = []byte(os.Getenv("JWT_SECRET"))
// // Boot up DB connection for life of application
goscrobble.InitDb()
defer goscrobble.CloseDbConn()