kite_http 0.1.1 icon indicating copy to clipboard operation
kite_http: ^0.1.1 copied to clipboard

A basic HTTP server library that support json & middleware

kite_http #

pub documentation


Features #

  • Middleware
    Support for custom middleware
  • RegExp Routing
    Uses Regex for routing

Example #

void main() {
  final server = KiteServer();

  server.use(middleware);

  server.handle(
    HandlerMetadata(
      RegExp(
        r"(\/)?",
        multiLine: true,
        caseSensitive: false,
      ),
      "GET",
    ),
    handler,
  );

  server.listen();
}

void middleware(Request req, Response res, Function() next) async {
  next();
}

void handler(Request req, Response res) async {
  final body = await req.json;

  return res.json(body);
}

1
likes
120
pub points
0%
popularity

Publisher

verified publisher iconharryet.me

A basic HTTP server library that support json & middleware

Repository (GitHub)
View/report issues

Documentation

API reference

License

Icon for licenses.Apache-2.0 (LICENSE)

More

Packages that depend on kite_http