Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
Oak is a middleware framework for Deno’s native HTTP server and Deno Deploy. It is influenced by Koa (hence the anagram) and includes a middleware router inspired by @koa/router.
Oak is a middleware framework for Deno’s native HTTP server and Deno Deploy. It is influenced by Koa (hence the anagram) and includes a middleware router inspired by @koa/router.
Oak is a middleware framework for Deno’s native HTTP server and Deno Deploy. It is influenced by Koa (hence the anagram) and includes a middleware router inspired by @koa/router.
All the code for this article can be found on my GitHub.
You can find a list of different installation methods on the official deno.land documentation and the deno_install repo.
// index.js import { Application, Router } from "https://deno.land/x/[email protected]/mod.ts" const router = new Router() const app = new Application() router.get("/", (ctx) => { ctx.response.body = "Hello from Router on Localhost 8080" ctx.response.headers.set("Content-Type", "text/html") }) router.get("/about", (ctx) => { ctx.response.body = "This page tells you about stuff" ctx.response.headers.set("Content-Type", "text/html") }) app.use(router.routes()) app.use(router.allowedMethods()) app.addEventListener('listen', () => { console.log(`Server running on localhost:8080`) }) app.listen({ port: 8080 })