vercel_edge 0.0.3+2 copy "vercel_edge: ^0.0.3+2" to clipboard
vercel_edge: ^0.0.3+2 copied to clipboard

Write and deploy Dart functions to the Vercel Edge network.

example/lib/main.dart

// import 'package:vercel_edge/vercel_edge.dart';
import 'package:shelf_router/shelf_router.dart';
import 'package:shelf/shelf.dart';
import 'package:vercel_edge/vercel_edge_shelf.dart';

void main() {
  // VercelEdge(fetch: (request) {
  //   return Response("Hello...");
  // });

  VercelEdgeShelf(fetch: (request) {
    final app = Router();

    app.get('/hello', (request) {
      return Response.ok("Hello...");
    });

    app.all('/<ignored|.*>', (request) {
      return Response.notFound('Not found');
    });

    return app(request);
  });
}
1
likes
0
pub points
0%
popularity

Publisher

verified publisherinvertase.io

Write and deploy Dart functions to the Vercel Edge network.

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

edge, edge_runtime, js, js_bindings, shelf

More

Packages that depend on vercel_edge