dpress 0.0.1+Omicron dpress: ^0.0.1+Omicron copied to clipboard
A lightweight express like framework.
import 'package:dpress/dpress.dart';
void main() async {
final app = Dpress();
app.addRoute("/", "GET", (DpressRequest request, DpressResponse response) {
response.send("Hello, /!");
});
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();
}