fallstrick_hosting 0.0.2 fallstrick_hosting: ^0.0.2 copied to clipboard
Code for hosting and starting up an Fallstrick application
fallstrick_hosting #
Usage #
A simple usage example:
import 'package:fallstrick_hosting/fallstrick_hosting.dart';
void main() {
createWebHostBuilder('localhost', 8080).build().run();
}
WebHostBuilder createWebHostBuilder(String address, int port) {
return WebHostBuilder().useHttpListener(address, port).configure((app) {
app.use(fooMiddleware);
app.use(headerMiddleware);
});
}
RequestDelegate fooMiddleware(RequestDelegate next) {
return (context) {
context.response.writeAsync('Foo==>');
next(context);
};
}
RequestDelegate headerMiddleware(RequestDelegate next) {
return (context) {
context.response.writeAsync('header==>');
next(context);
};
}
Features and bugs #
Please file feature requests and bugs at the issue tracker.