first commit

This commit is contained in:
2020-07-16 10:51:50 +02:00
commit 0cb77cc6c7
15 changed files with 551 additions and 0 deletions

39
cmd/jwtserver/main.go Normal file
View 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))
}