Ocean/System/InitHandlers.go
Thorsten Sommer f33f7b5c29 Refactoring, Bugfix & Updates
+ Refactored all imports
+ Fixed a bug for the logging regarding removing \n \t \r
+ Updated to current MGO release
+ Changed the name of ICCC
2014-10-19 19:19:11 +02:00

33 lines
1.2 KiB
Go

package System
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"
)
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.`)
}