dia_body 0.0.1 copy "dia_body: ^0.0.1" to clipboard
dia_body: ^0.0.1 copied to clipboard

outdated

Request body parser middleware for Dia http serer.

The request body parser middleware for Dia.

!!IN PROGRESS!!! #

Usage: #

A simple usage example:

class ContextWithBody extends Context with ParsedBody {
  ContextWithBody(HttpRequest request) : super(request);
}

void main() {
  final app = App<ContextWithBody>();

  app.use(body());

  app.use((ctx, next) async {
    ctx.body = ''' 
    query=${ctx.query}
    parsed=${ctx.parsed}
    files=${ctx.files}
    ''';
  });

  /// Start server listen on localhsot:8080
  app
      .listen('localhost', 8080)
      .then((info) => print('Server started on http://localhost:8080'));
}

Named params: #

  • uploadDirectory - directory for upload files. Default: Directory.systemTemp

Use with: #

  • dia - A simple dart http server in Koa2 style.
  • dia_router - Middleware like as koa_router.
  • dia_cors - CORS middleware.

Plans: #

  • dia_static - Package to serve static files.

Features and bugs: #

I will be glad for any help and feedback! Please file feature requests and bugs at the issue tracker.

1
likes
0
pub points
51%
popularity

Publisher

verified publisherawcoding.com

Request body parser middleware for Dia http serer.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

dia, http_parser, mime, uuid

More

Packages that depend on dia_body