import 'package:web/web.dart' as web; final RegExp recipeRegex = RegExp(r'^\/recipe\/(\d+)$'); void main() { print('Dart infrastructure is available.'); print('Window location: `${web.window.location}`'); if (recipeRegex.hasMatch(web.window.location.pathname)) { recipe(); return; } print('Frontend code is inactive for this path `${web.window.location.pathname}`.'); } void recipe() { print('Handling /recipe page.'); }