first commit
This commit is contained in:
39
cmd/jwtserver/main.go
Normal file
39
cmd/jwtserver/main.go
Normal file
@ -0,0 +1,39 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"forges.cadoles.com/go-jwtserver/internal/router"
|
||||
"github.com/joho/godotenv"
|
||||
)
|
||||
|
||||
var (
|
||||
configFile = ""
|
||||
dumpConfig = false
|
||||
version = false
|
||||
confWebadress = ""
|
||||
)
|
||||
|
||||
func init() {
|
||||
e := godotenv.Load() //Load .env file
|
||||
if e != nil {
|
||||
fmt.Print(e)
|
||||
}
|
||||
confWebadress = os.Getenv("web_adress")
|
||||
}
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
|
||||
router := router.InitializeRouter()
|
||||
// Passing -routes to the program will generate docs for the above
|
||||
// router definition. See the `routes.json` file in this folder for
|
||||
// the output.
|
||||
log.Printf("listening on '%s'", confWebadress)
|
||||
log.Fatal(http.ListenAndServe(confWebadress, router))
|
||||
|
||||
}
|
Reference in New Issue
Block a user