0.2.0 • Published 9 years ago
phantasy-http-server v0.2.0
phantasy-http-server
HTTP server library built with Phantasy
Server
createServer
:: (() -> EffTask fxa e) -> RequestHandler e fxb -> HttpServer fxa fxb eCreates a new HttpServer.
startServer
:: HttpServerOpts -> HttpServer fxa fxb e -> EffTask (fxa & fxb) void ErrorTakes an options object and returns an EffTask that succeeds with the start of the server or fails with an Error.
Router
get
:: string -> RouteHandler e fx p q -> Route e fx p qCreates a GET route that matches the given path.
post
:: string -> RouteHandler e fx p q -> Route e fx p qCreates a POST route that matches the given path.
put
:: string -> RouteHandler e fx p q -> Route e fx p qCreates a PUT route that matches the given path.
del
:: string -> RouteHandler e fx p q -> Route e fx p qCreates a DELETE route that matches the given path.
mergeRoutes
:: Array (Routable e fx) -> Routable e fxTakes an array of Routable objects and merges them into a single Routable object.
dispatch
:: Routable e fx -> RequestHandler e fxTakes a Routable and returns a RequestHandler.
0.2.0
9 years ago