Attributes
Popular
Repository
Current version released
4 years ago
Versions
- v1.3.3Latest
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.6
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.0
- v1.0.3
- v1
- v1.0.2
- v1.0.1
- v1.0.0
- v1.0.0-rc10
- v1.0.0-rc9
- v1.0.0-rc8
- v1.0.0-rc7
- v1.0.0-rc6
- v1.0.0-rc5
- v1.0.0-rc4
- v1.0.0-rc3
- v1.0.0-rc2
- v1.0.0-rc1
- v0.2.11
- v0.2.10
- v0.2.9
- v0.2.8
- v0.2.7
- v0.2.6
- v0.2.5
- v0.2.4
- v0.2.3
- v0.2.2
- v0.2.1
- v0.2.0
- v0.1.11
- v0.1.10
- v0.1.9
- v0.1.8
- v0.1.7
- v0.1.6
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
Abc
A better Deno framework to create web application
Quick links
Documentation, demos, and guides
Hello World
import { abc } from "https://deno.sh/abc/mod.ts";
// OR import { abc } from "https://deno.land/x/abc/mod.ts";
const app = abc();
app
.get("/hello", c => {
return "Hello, Abc!";
})
.start("0.0.0.0:8080");
Routing
app
.get("/", findAll)
.get("/:id", findOne)
.post("/", create)
.delete("/users/:id", deleteUser);
Path Parameters
// app.get("/users/:id", getUser)
function getUser(c: Context) {
// User ID from path `users/:id`
const { id } = c.param;
return id;
}
Browse to http://localhost:8080/users/zhmushan and you should see “zhmushan” on the page.
Static Content
Serve any file from static directory.
app.static("/static/*files");
Middleware
import { logger } from "https://deno.sh/abc/middleware.ts";
// Root middleware
app.use(logger());