35 lines
573 B
Go
35 lines
573 B
Go
package main
|
|
|
|
import (
|
|
"git.mowie.cc/konrad/Library/models"
|
|
"git.mowie.cc/konrad/Library/routes"
|
|
|
|
"fmt"
|
|
)
|
|
|
|
// UserLogin Object to recive user credentials in JSON format
|
|
type UserLogin struct {
|
|
Username string `json:"username" form:"username"`
|
|
Password string `json:"password" form:"password"`
|
|
}
|
|
|
|
func main() {
|
|
|
|
// Set Engine
|
|
err := models.SetEngine()
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
}
|
|
|
|
// Init Config
|
|
err = models.SetConfig()
|
|
if err != nil {
|
|
fmt.Println(err)
|
|
}
|
|
|
|
// Start the webserver
|
|
e := routes.NewEcho()
|
|
routes.RegisterRoutes(e)
|
|
e.Start(":8082")
|
|
}
|