Skip to content

A basic HTTP server library that support json & middleware

License

Notifications You must be signed in to change notification settings

nyxx-discord/kite_http

Repository files navigation

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);
}

About

A basic HTTP server library that support json & middleware

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages