PageRenderTime 343ms CodeModel.GetById 151ms app.highlight 1ms RepoModel.GetById 190ms app.codeStats 0ms

/todo.io

http://github.com/pgregory/blackpool
Unknown | 25 lines | 20 code | 5 blank | 0 comment | 0 complexity | d2a06bc725d933f839bc315c7cf71474 MD5 | raw file
 1Importer addSearchPath(Directory currentWorkingDirectory asMutable appendPathSeq("lib"))
 2Importer addSearchPath(Directory currentWorkingDirectory asMutable appendPathSeq("app/models"))
 3Importer addSearchPath(Directory currentWorkingDirectory asMutable appendPathSeq("app/components"))
 4
 5server := HttpServer clone do(
 6  setPort(8090)
 7
 8  sessions := Registry clone
 9
10  renderResponse := method(request, response,
11    session := nil
12    cookie := request cookies at("ioweb")
13    if (cookie != nil, session = sessions find(cookie))
14    if (session == nil,
15      session = Session clone do(
16        root ::= RootContent clone
17      )
18      response setCookie("ioweb", sessions register(session))
19    )
20
21    session handle(request, response)
22  )
23)
24
25server start