shelf_azure_application_insights 0.0.2 copy "shelf_azure_application_insights: ^0.0.2" to clipboard
shelf_azure_application_insights: ^0.0.2 copied to clipboard

A Shelf middleware to send request data to Azure Application Insights.

example/shelf_azure_application_insights_example.dart

import 'package:shelf/shelf.dart';
import 'package:shelf/shelf_io.dart' as shelf_io;
import 'package:shelf_azure_application_insights/shelf_azure_application_insights.dart';

void main() async {
  var handler = const Pipeline()
      .addMiddleware(azureApplicationInsightsMiddleware(
          connectionString: '<APPLICATION_INSIGHTS_CONNECTION_STRING>'))
      .addHandler(_echoRequest);

  var server = await shelf_io.serve(handler, 'localhost', 8080);

  // Enable content compression
  server.autoCompress = true;

  print('Serving at http://${server.address.host}:${server.port}');
}

Response _echoRequest(Request request) =>
    Response.ok('Request for "${request.url}"');
1
likes
140
points
55
downloads

Publisher

verified publisherevoleen.com

Weekly Downloads

A Shelf middleware to send request data to Azure Application Insights.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

azure_application_insights, http, shelf

More

Packages that depend on shelf_azure_application_insights