We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 275ef28 commit 6638a67Copy full SHA for 6638a67
server.ts
@@ -1,5 +1,16 @@
1
-import { Application } from "https://deno.land/x/oak/mod.ts";
+import { Application, Router } from "https://deno.land/x/oak/mod.ts";
2
3
const app = new Application();
4
5
+const router = new Router();
6
+
7
+app.use(router.routes());
8
+app.use(router.allowedMethods());
9
10
+router.get("/api/hello-world", ({ response }: { response: any }) => {
11
+ console.log(response);
12
+ response.body = "Hello World";
13
+ console.log(JSON.stringify(response));
14
+});
15
16
await app.listen({ port: 3000 });
0 commit comments