2018-06-30 00:57:05 +00:00
|
|
|
package handlers
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/hunterlong/statup/core"
|
|
|
|
"net/http"
|
|
|
|
)
|
|
|
|
|
|
|
|
type index struct {
|
2018-07-14 02:37:39 +00:00
|
|
|
Core *core.Core
|
2018-06-30 00:57:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func IndexHandler(w http.ResponseWriter, r *http.Request) {
|
2018-07-05 02:18:02 +00:00
|
|
|
if core.CoreApp.DbConnection == "" {
|
2018-06-30 00:57:05 +00:00
|
|
|
http.Redirect(w, r, "/setup", http.StatusSeeOther)
|
|
|
|
return
|
|
|
|
}
|
2018-07-14 02:37:39 +00:00
|
|
|
ExecuteResponse(w, r, "index.html", core.CoreApp)
|
2018-06-30 00:57:05 +00:00
|
|
|
}
|