deno web server code example
Example 1: deno web server
// server.ts
import Denoot from "https://deno.land/x/denoot/mod.ts";
const app = Denoot.app(3000);
app.get("/", (req, res) => {
res.send("Hello World!");
});
// then run "deno run --allow-net --unstable server.ts"
// open http://localhost:3000
// you're welcome!
// read more: https://denoot.dev
Example 2: how to run a deno server
deno run (the allow flags your server needs) your_server_name.(ts,js)