Idealist
Functional HTTP micro-framework.
Usage
//Import dependencies.const App = ;const R = ; //Import some Free Moands we'd like to use.const FreeState = ; //Some lenses to work with the Response structure.const headers = R;const body = R;const status = R; //Create an empty App.const app = App //We can just map over the monad and use the "headers" lens to modify the response headers //We can install our own interpreter, which must return a StateFuture. //And now we can use it! //We can plain ignore the input Monad and return our own. This is like not calling "next" //Set the status and body by using lenses; //The returned app instance is also "middleware".//Note that we must first "concat" to join the interpreters of both apps.const actualApp = App; //All we're doing is chaining over Free Monads, so we could write our middleware like:const middleware = Monad; //Middleware are pure compsable functions which compose in reverse, so we could:actualApp; //Mounts an app on the specified port. The third argument will appear on the//request state as "config".App;