# import the modules that you want for your website
from websiteMinimal import websiteMinimal

import ErrorPages
import types

# then define what paths should trigger those modules, in order of priority
# i.e. put more specific URL handlers first
URLHandlers = [
    #["/fish/"                  , websiteHandlerFish],
    #["/formhandler"            , websiteHandlerForms],
    #["/kamaelia/irc-view/"     , websiteKamaeliaIrcLogs],
    #["/error"                  , websiteHandlerBuggy],    
    ["/"                       , websiteMinimal] #should always be last as catches all
]
# the second item should be a component class that takes one parameter (the request)
# OR some other function that takes one parameter returns a component instance


# this function decides what function should deal with a request
def createRequestHandler(request):
    if request.get("bad"):
        return ErrorPages.websiteErrorPage(400, request.get("errormsg",""))
    else:
        for (prefix, handler) in URLHandlers:
            if request["raw-uri"][:len(prefix)] == prefix:
                request["uri-suffix-trigger"] = prefix
                return handler(request)
            
    return ErrorPages.websiteErrorPage(404, "No resource handlers could be found for the requested URL.")

@@ -86,16 +86,72 @@
 eMinimal
+%0Afrom websiteSessionExample import websiteSessionExample
 %0A%0Aimport
@@ -537,20 +537,73 @@
 rBuggy%5D,
+%0A
     
+%5B%22/session/%22               , websiteSessionExample%5D,
 %0A    %5B%22/
@@ -1201,11 +1201,11 @@
 uri-
-suf
+pre
 fix-
@@ -1223,16 +1223,89 @@
  prefix%0A
+                request%5B%22uri-suffix%22%5D = request%5B%22raw-uri%22%5D%5Blen(prefix):%5D%0A
         

Add websiteSessionExample.py