import { Mith } from "https://deno.land/x/mith@v0.9.6/mod.ts";
A class which registers middleware (via .use()
) and then processes
inbound requests against that middleware (via .listen()
).
Methods
getMiddlewareStack based on the requested stack returns the correct middleware items
nextMiddleware function will trigger the next middleware in line In case an error is passed it moves to the error middleware stack
Returns the next stack in line before > main > after || error > after
Listens to the async iterable server instance for incoming requests Runs the stack of middleware for each request
Calls sendResponse in case Mith server is already setup Calls the next function in case this is a sub application Stops execution otherwise
Dispatch function will trigger the middleware in sequence based on the current stack
Register middleware to be used when next(error) is called.
Create an HTTP server with given options
const options = { hostname: "localhost", port: 8000, }
mith.listen(options)
Register middleware to be used with the application.