fallstrick_hosting 0.0.3 copy "fallstrick_hosting: ^0.0.3" to clipboard
fallstrick_hosting: ^0.0.3 copied to clipboard

Code for hosting and starting up an Fallstrick application

fallstrick_hosting #

language license

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.

0
likes
30
pub points
0%
popularity

Publisher

unverified uploader

Code for hosting and starting up an Fallstrick application

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

More

Packages that depend on fallstrick_hosting