Initial bootrap of application
- Creates scaffold for router and server - Main program set up for environment, OS signal listener - Makefile generic commands
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/joho/godotenv"
|
||||
"github.com/kelseyhightower/envconfig"
|
||||
)
|
||||
|
||||
type config struct {
|
||||
Env string `default:"dev"`
|
||||
APIPort int `default:3000`
|
||||
LogLevel string `default:"debug"`
|
||||
}
|
||||
|
||||
func load() (cfg config, err error) {
|
||||
_ = godotenv.Load("cmd/api/.env")
|
||||
err = envconfig.Process("", &cfg)
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user