import { Application } from "https://dotland.deno.dev/x/abc@v1.2.4/mod.ts";
Hello World.
const app = new Application();
app .get("/hello", (c) => { return "Hello, Abc!"; }) .start({ port: 8080 });
Properties
middleware: MiddlewareFunc[]
premiddleware: MiddlewareFunc[]
renderer: Renderer | undefined
router: Router
Methods
add(): Application
any(): Application
file(): Application
Register a new route with path to serve a static file with optional route-level middleware.
app.file("/", "public/index.html");
get(): Application
group(prefix: string, ...m: MiddlewareFunc[]): Group
group
creates a new router group with prefix and optional group level middleware.
head(): Application
match(): Application
patch(): Application
post(): Application
put(): Application
Register a new route with path prefix to serve static files from the provided root directory.
For example, a request to /static/js/main.js
will fetch and serve assets/js/main.js
file.
app.static("/static", "assets");
trace(): Application