Managed to get a simple and NOT SECURE login system going.
This commit is contained in:
parent
75b1eb1edb
commit
3bd8d38847
7 changed files with 63 additions and 23 deletions
14
main.go
14
main.go
|
@ -14,17 +14,21 @@ import (
|
|||
|
||||
"zedshaw.games/webapp/api"
|
||||
"zedshaw.games/webapp/data"
|
||||
"zedshaw.games/webapp/config"
|
||||
)
|
||||
|
||||
|
||||
func main() {
|
||||
|
||||
config.Load("config.toml")
|
||||
log.Printf("ADMIN is %s", config.Settings.Admin)
|
||||
|
||||
log.SetFlags(log.LstdFlags | log.Lshortfile)
|
||||
|
||||
engine := html.New("./views", ".html")
|
||||
engine := html.New(config.Settings.Views, ".html")
|
||||
|
||||
app := fiber.New(fiber.Config{
|
||||
Views: engine,
|
||||
ViewsLayout: "layouts/main",
|
||||
ViewsLayout: config.Settings.Layouts,
|
||||
CaseSensitive: true,
|
||||
StrictRouting: true,
|
||||
})
|
||||
|
@ -33,11 +37,11 @@ func main() {
|
|||
app.Use(recov.New())
|
||||
|
||||
api.Setup(app)
|
||||
data.Setup("sqlite3", "db.sqlite3")
|
||||
data.Setup(config.Settings.Database.Driver, config.Settings.Database.Url)
|
||||
|
||||
// this sets up graceful shutdown
|
||||
go func() {
|
||||
if err := app.Listen(":5001"); err != nil {
|
||||
if err := app.Listen(config.Settings.Port); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
}()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue