Skip to content

Instantly share code, notes, and snippets.

@felangel
Last active December 16, 2022 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felangel/1a04fe2a797c217b750783d30ecebcf4 to your computer and use it in GitHub Desktop.
Save felangel/1a04fe2a797c217b750783d30ecebcf4 to your computer and use it in GitHub Desktop.
Dart Frog Catch All Handler Custom Entrypoint
import 'dart:io';
import 'package:dart_frog/dart_frog.dart';
Future<HttpServer> run(Handler handler, InternetAddress ip, int port) {
final cascade = Cascade().add(handler).add(catchAll);
return serve(cascade.handler, ip, port);
}
Response catchAll(RequestContext context) => Response(body: 'Catch All');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment