vercel_edge 0.0.4+3 copy "vercel_edge: ^0.0.4+3" to clipboard
vercel_edge: ^0.0.4+3 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
120
pub points
13%
popularity

Publisher

verified publisherinvertase.io

Write and deploy Dart functions to the Vercel Edge network.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

edge, edge_runtime, js, js_bindings, shelf

More

Packages that depend on vercel_edge