server.coffee
changeset 3 0fa2f12fcb3c
parent 2 26148011541f
child 4 cbba85b1f677
equal deleted inserted replaced
2:26148011541f 3:0fa2f12fcb3c
    29           path: rq.path
    29           path: rq.path
    30           pathInfo: rq.pathInfo
    30           pathInfo: rq.pathInfo
    31         response: rs
    31         response: rs
    32     })
    32     })
    33   }, Apps.methodNotAllowed
    33   }, Apps.methodNotAllowed
       
    34 
       
    35   'login': Apps.Method {
       
    36     'POST': Apps.JsonRequest((o, rq, rs) =>
       
    37       log.info("Login", o)
       
    38       {
       
    39         status: 200
       
    40         headers: {}
       
    41         data:
       
    42           configId: 'cfg1'
       
    43           sessionId: 'sess1'
       
    44       })
       
    45   }
    34 }
    46 }
    35 
    47 
    36 app = Apps.Chain().use(() => Apps.HandleJsonResponses(route, null, "  "))
    48 app = Apps.Chain()
       
    49   .use(() => Apps.Log(Apps.HandleJsonResponses(route, null, "  "),
       
    50     (m) => log.info("Access: " + m)))
    37   .end()
    51   .end()
    38 
    52 
    39 Http.Server(app).listen(3000)
    53 Http.Server(app).listen(3000)
    40 
    54 
    41 # vim: et ts=2 sw=2 
    55 # vim: et ts=2 sw=2