Our great sponsors
-
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.
-
Appwrite
Appwrite - The Open Source Firebase alternative introduces iOS support . Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more!
-
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 })