A microframework for Deno focused on resource creation and content negotiation.
// File: app.ts
import Drash from "https://deno.land/x/drash@v0.23.0/mod.ts";
class HomeResource extends Drash.Http.Resource {
static paths = ["/"];
public GET() {
this.response.body = "Hello World!";
return this.response;
}
}
let server = new Drash.Http.Server({
address: "localhost:1337",
response_output: "text/html",
resources: [HomeResource]
});
server.run();
$ deno --allow-net --allow-env app.ts
For a more complicated application, try out the Hello World tutorial series!
Documentation
For full documentation, visit https://drash.io.
Features
- HTTP Resources
- Content Negotiation
- Static Path Routing
- Request Path Params Parsing
/users/:id
/users/{id}
/users/([0-9]+)
- Request URL Query Params Parsing
/products?name=beignet&action=purchase
- Request Body Parsing
- application/x-www-form-urlencoded (e.g,
username=root&password=alpine
) - application/json (e.g.,
{"username":"root","password":"alpine"}
)
- application/x-www-form-urlencoded (e.g,
Contributing
Contributors are welcomed!