import 'package:backend/middleware/auth_middleware.dart';
import 'package:dart_frog/dart_frog.dart';

Handler middleware(Handler handler) {
  // Apply auth middleware to all routes except /auth
  return (context) async {
    if (context.request.uri.path.startsWith('/auth')) {
      return handler(context);
    }
    return authMiddleware()(handler)(context);
  };
}
