2014-04-26 09:18:56 +00:00
|
|
|
package System
|
|
|
|
|
2014-10-19 17:19:11 +00:00
|
|
|
import (
|
|
|
|
"github.com/SommerEngineering/Ocean/ConfigurationDB"
|
|
|
|
"github.com/SommerEngineering/Ocean/ICCC"
|
|
|
|
"github.com/SommerEngineering/Ocean/Log"
|
|
|
|
LM "github.com/SommerEngineering/Ocean/Log/Meta"
|
|
|
|
"github.com/SommerEngineering/Ocean/NumGen"
|
|
|
|
"github.com/SommerEngineering/Ocean/Robots"
|
|
|
|
"github.com/SommerEngineering/Ocean/StaticFiles"
|
|
|
|
"github.com/SommerEngineering/Ocean/WebContent"
|
|
|
|
"net/http"
|
|
|
|
)
|
2014-04-26 09:18:56 +00:00
|
|
|
|
|
|
|
func InitHandlers() {
|
|
|
|
|
|
|
|
initSystem()
|
|
|
|
Log.LogShort(senderName, LM.CategorySYSTEM, LM.LevelINFO, LM.MessageNameSTARTUP, `Register now all system handlers.`)
|
|
|
|
|
|
|
|
http.HandleFunc(`/framework/`, WebContent.HandlerDeliverFramework)
|
|
|
|
http.HandleFunc(`/staticFiles/`, StaticFiles.HandlerStaticFiles)
|
|
|
|
http.HandleFunc(`/next/number`, NumGen.HandlerGetNext)
|
|
|
|
http.HandleFunc(`/robots.txt`, Robots.HandlerRobots)
|
|
|
|
http.HandleFunc(`/ICCC`, ICCC.ICCCHandler)
|
|
|
|
|
|
|
|
if ConfigurationDB.Read(`MapStaticFiles2Root`) == "true" {
|
|
|
|
Log.LogShort(senderName, LM.CategorySYSTEM, LM.LevelINFO, LM.MessageNameSTARTUP, `The static files are mapped to the root.`)
|
|
|
|
http.HandleFunc(`/`, StaticFiles.HandlerMapStaticFiles2Root)
|
|
|
|
}
|
|
|
|
|
|
|
|
Log.LogShort(senderName, LM.CategorySYSTEM, LM.LevelINFO, LM.MessageNameSTARTUP, `Done with registering all system handler.`)
|
|
|
|
}
|