edge_runtime_unofficial 0.0.11 edge_runtime_unofficial: ^0.0.11 copied to clipboard
Runtime APIs for running Dart on Edge function environments.
import 'package:edge_runtime_unofficial/edge_runtime_unofficial.dart';
import 'package:http/http.dart' as http;
void main() {
// Setup the runtime environment.
setupRuntime();
}
/// A fetch event handler.
Future<Response> fetchHandler(Request request) async {
print('do request');
final r = await http.get(Uri.parse('https://jsonplaceholder.typicode.com/todos/1'));
print(r.body);
return Response('Hello, world!!', status: 200);
}