dia_cors 0.0.3 copy "dia_cors: ^0.0.3" to clipboard
dia_cors: ^0.0.3 copied to clipboard

outdated

CORS middleware for Dia http server. Add CORS headers to response. Use it with 'dia' and 'dia_router' packages

example/dia_cors_example.dart

import 'package:dia/dia.dart' as dia;
import 'package:dia_cors/dia_cors.dart';

void main() {
  final app = dia.App();

  /// Add CORS middleware
  app.use(cors());

  /// final middleware to response
  app.use((ctx, next) async {
    ctx.body = 'success';
  });

  /// Start server listen on localhsot:8080
  app
      .listen('localhost', 8080)
      .then((info) => print('Server started on http://localhost:8080'));
}
2
likes
0
pub points
63%
popularity

Publisher

verified publisherawcoding.com

CORS middleware for Dia http server. Add CORS headers to response. Use it with 'dia' and 'dia_router' packages

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

dia

More

Packages that depend on dia_cors