public UserModule(Authentication auth) : base("/API/User") { Get["/"] = _ => { return auth.Verify(Authentication.SessionIdFromRequest(Request)); }; Post["/"] = _ => { return auth.Register(new User(this.Bind<UserLogin>())); }; }
public PublicModule(Authentication auth) { Get["/"] = _ => { var response = new GenericFileResponse("Content\\index.html"); response.ContentType = "text/html"; return response; }; Get["/{name*}"] = _ => { return HttpStatusCode.Forbidden; }; }
public MessageModule(Authentication auth) : base("/API/Message") { Post["/"] = _ => { User user = auth.Verify(Authentication.SessionIdFromRequest(Request)); if (user == null) { return HttpStatusCode.Unauthorized; } auth.Send(user, this.Bind<Message>()); return user; }; }
public Bootstrapper() { _auth = new Authentication(); }