Started to implement server

This commit is contained in:
didier amyot committed 2023-06-11 15:43:45 -04:00
1 parent 1f2ea8b7e5
commit 17a1b4bed3
177 files changed
+29894 -74

No files matched your search

+15 -6
View File
@@ -1,9 +1,18 @@
import { Application } from 'https://deno.land/x/oak/mod.ts';
import { Application, Router } from 'https://deno.land/x/oak/mod.ts';
import { buildAPI } from './restapi.ts';
import { DenoKVFileService } from "./fileservice.ts";
const app = new Application();
async function main(){
const app = new Application();
const kv = await Deno.openKv();
const fileService = new DenoKVFileService(kv);
const router = new Router({ prefix: '/v1' });
app.use((ctx) => {
ctx.response.body = 'Hello World!';
});
app.use(
buildAPI(router, fileService).routes(),
);
await app.listen({ port: 9000 });
await app.listen({ port: 9000 });
}
await main();