dpress 0.0.2+beta copy "dpress: ^0.0.2+beta" to clipboard
dpress: ^0.0.2+beta copied to clipboard

A lightweight express like framework.

example/dpress_example.dart

import 'package:dpress/dpress.dart';

void main() async {
  final app = Dpress();

  // app.addRoute("/", "GET", (DpressRequest request, DpressResponse response) {
  //   response.send("Hello, /!");
  // });

  app.get("/", (req, res) => res.json({"time": DateTime.now().toString()}));

  app.get("/a", (DpressRequest request, DpressResponse response) {
    response.send("Hello, /a!");
  });

  app.addRoute("/hello", "GET",
      (DpressRequest request, DpressResponse response) {
    response.send("Hello, World!");
  });

  app.addRoute("/hello", "POST",
      (DpressRequest request, DpressResponse response) {
    response.send("Hello, POST!");
  });

  await app.start();
}
0
likes
135
points
0
downloads

Publisher

unverified uploader

Weekly Downloads

A lightweight express like framework.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on dpress