Last active
December 16, 2022 17:40
-
-
Save felangel/1a04fe2a797c217b750783d30ecebcf4 to your computer and use it in GitHub Desktop.
Dart Frog Catch All Handler Custom Entrypoint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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