Fixed production server login
This commit is contained in:
12
main.go
12
main.go
@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"errors"
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/arn"
|
||||
@ -37,6 +38,14 @@ func main() {
|
||||
return components.Layout(app, content)
|
||||
}
|
||||
|
||||
// Production or Development mode
|
||||
host, _ := os.Hostname()
|
||||
isProduction := host != "home"
|
||||
|
||||
if !isProduction {
|
||||
app.Config.Domain = "beta.notify.moe"
|
||||
}
|
||||
|
||||
// Ajax routes
|
||||
app.Ajax("/", dashboard.Get)
|
||||
app.Ajax("/anime", search.Get)
|
||||
@ -145,6 +154,9 @@ func main() {
|
||||
return ctx.Text("Hello World")
|
||||
})
|
||||
|
||||
// Authentication
|
||||
EnableLogin(app)
|
||||
|
||||
// Let's go
|
||||
app.Run()
|
||||
}
|
||||
|
Reference in New Issue
Block a user