Library/main.go

35 lines
589 B
Go
Raw Normal View History

2017-10-06 09:25:37 +00:00
package main
import (
"git.mowie.cc/konrad/Library/models"
2017-11-07 15:35:10 +00:00
"git.mowie.cc/konrad/Library/routes"
"fmt"
)
2017-10-06 09:25:37 +00:00
2017-11-08 16:12:05 +00:00
// UserLogin Object to recive user credentials in JSON format
type UserLogin struct {
Username string `json:"username" form:"username"`
Password string `json:"password" form:"password"`
}
2017-11-07 15:35:10 +00:00
func main() {
// Init Config
err := models.SetConfig()
if err != nil {
fmt.Println(err)
}
// Set Engine
err = models.SetEngine()
if err != nil {
fmt.Println(err)
}
// Start the webserver
2017-10-06 10:09:58 +00:00
e := routes.NewEcho()
routes.RegisterRoutes(e)
2017-11-16 12:04:45 +00:00
e.Start(models.Config.Interface)
2017-10-06 09:25:37 +00:00
}