1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 23:59:47 +02:00

removed old API

This commit is contained in:
Harvey Kandola 2017-08-02 15:26:31 +01:00
parent e284a46f86
commit 562872a4a8
105 changed files with 337 additions and 14496 deletions

View file

@ -16,9 +16,9 @@ import (
"html/template"
"net/http"
"github.com/documize/community/core/api"
"github.com/documize/community/core/env"
"github.com/documize/community/core/secrets"
"github.com/documize/community/domain"
)
// SiteInfo describes set-up information about the site
@ -30,10 +30,16 @@ func init() {
SiteInfo.DBhash = secrets.GenerateRandomPassword() // do this only once
}
// Handler contains the runtime information such as logging and database.
type Handler struct {
Runtime *env.Runtime
Store *domain.Store
}
// EmberHandler serves HTML web pages
func EmberHandler(w http.ResponseWriter, r *http.Request) {
func (h *Handler) EmberHandler(w http.ResponseWriter, r *http.Request) {
filename := "index.html"
switch api.Runtime.Flags.SiteMode {
switch h.Runtime.Flags.SiteMode {
case env.SiteModeOffline:
filename = "offline.html"
case env.SiteModeSetup: