Commit 61ea6d72 authored by Bas Lijnse's avatar Bas Lijnse

Updated config and engine to use configurable server path instead of the fixed "/handlers"

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/trunk@684 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent f766774d
......@@ -9,6 +9,7 @@ definition module Config
, rootPassword :: !String // Password for the 'root' superuser.
, sessionTime :: !Int // Time (in seconds) before inactive sessions are garbage collected. Default is 3600 (one hour).
, serverPort :: !Int // The TCP port the server runs on. Default is 80.
, serverPath :: !String // The path at which the services are served (default /handlers)
, debug :: !Bool // Run the server in debug mode.
}
......
......@@ -11,6 +11,7 @@ defaultConfig =
, rootPassword = ""
, sessionTime = 3600
, serverPort = 80
, serverPath = "/handlers"
, debug = False
}
......
......@@ -25,18 +25,18 @@ PATH_SEP :== "\\"
// The iTasks engine consist of a set of HTTP request handlers
engine :: Config [Workflow] -> [(!String -> Bool, HTTPRequest *World -> (!HTTPResponse, !*World))]
engine config flows
= [((==) "/handlers/authenticate", handleAnonRequest config flows handleAuthenticationRequest)
,((==) "/handlers/deauthenticate", handleSessionRequest config flows handleDeauthenticationRequest)
,((==) "/handlers/new/list", handleSessionRequest config flows handleNewListRequest)
,((==) "/handlers/new/start", handleSessionRequest config flows handleNewStartRequest)
,((==) "/handlers/work/list", handleSessionRequest config flows handleWorkListRequest)
,((==) "/handlers/work/tab", handleSessionRequest config flows handleWorkTabRequest)
,((==) "/handlers/work/property", handleSessionRequest config flows handlePropertyRequest)
,((==) "/handlers/data/users", handleSessionRequest config flows handleUserListRequest)
,((==) "/handlers/rpc/request", handleSessionRequest config flows handleRPCListRequest)
,((==) "/handlers/rpc/response", handleSessionRequest config flows handleRPCUpdates)
,((==) "/handlers/debug/taskforest", handleSessionRequest config flows handleTaskForestRequest)
,((==) "/handlers/debug/processtable", handleSessionRequest config flows handleProcessTableRequest)
= [((==) (config.serverPath +++ "/authenticate"), handleAnonRequest config flows handleAuthenticationRequest)
,((==) (config.serverPath +++ "/deauthenticate"), handleSessionRequest config flows handleDeauthenticationRequest)
,((==) (config.serverPath +++ "/new/list"), handleSessionRequest config flows handleNewListRequest)
,((==) (config.serverPath +++ "/new/start"), handleSessionRequest config flows handleNewStartRequest)
,((==) (config.serverPath +++ "/work/list"), handleSessionRequest config flows handleWorkListRequest)
,((==) (config.serverPath +++ "/work/tab"), handleSessionRequest config flows handleWorkTabRequest)
,((==) (config.serverPath +++ "/work/property"), handleSessionRequest config flows handlePropertyRequest)
,((==) (config.serverPath +++ "/data/users"), handleSessionRequest config flows handleUserListRequest)
,((==) (config.serverPath +++ "/rpc/request"), handleSessionRequest config flows handleRPCListRequest)
,((==) (config.serverPath +++ "/rpc/response"), handleSessionRequest config flows handleRPCUpdates)
,((==) (config.serverPath +++ "/debug/taskforest"), handleSessionRequest config flows handleTaskForestRequest)
,((==) (config.serverPath +++ "/debug/processtable"), handleSessionRequest config flows handleProcessTableRequest)
,(\_ -> True, handleStaticResourceRequest)
]
workflow :: String (Task a) -> Workflow | iTask a
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment