30 lines
442 B
Go
30 lines
442 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
|
|
"custodial/pkg/rest"
|
|
|
|
"github.com/joho/godotenv"
|
|
)
|
|
|
|
// @securityDefinitions.apikey ApiKeyAuth
|
|
// @in header
|
|
// @name Authorization
|
|
func main() {
|
|
|
|
env := flag.String("env", "dev", "Environment")
|
|
flag.Parse()
|
|
|
|
if *env != "production" {
|
|
err := godotenv.Load("dev.env")
|
|
if err != nil {
|
|
fmt.Println("Error loading dev.env file")
|
|
}
|
|
}
|
|
|
|
router := rest.Router()
|
|
router.Run(":8080")
|
|
}
|