a pleasant http framework for deno
import { Server } from "https://deno.land/x/pleasant@v0.0.1/lib/lib.ts";
import { Server } from "https://deno.land/x/pleasant@v0.0.1/lib/lib.ts";
const app = new Server(8080);
app.get("/", (_, res) => {
res.status(400).send("hello");
});
app.up();
import { Server } from "https://deno.land/x/pleasant@v0.0.1/lib/lib.ts";
const app = new Server(8080);
app.post("/", (req, res) => {
res.status(200).send(req.body);
});
app.up();
import { Server } from "https://deno.land/x/pleasant@v0.0.1/lib/lib.ts";
const app = new Server(8080);
app.get("/index", (req, res) => {
res.status(400).file("/index.html");
});
app.up();
import { Server } from "https://deno.land/x/pleasant@v0.0.1/lib/lib.ts";
const app = new Server(8080);
app.static("/static");
app.up();
import { Server } from "https://deno.land/x/pleasant@v0.0.1/lib/lib.ts";
const app = new Server(8080);
app.get("/index", (req, res) => {
res.header("header name","header value").status(400).file("/index.html");
});
app.up();
app.get("/params",(req,res)=>{
res.status(200).send(req.params);
})
for host/params?p1=123&p2=12
return {"p1":"123","p2":"12"}