import { Application, Router, oakCors } from './deps.ts'; import { buildAPI } from './restapi.ts'; import { DenoKVFileService } from './services/mod.ts'; import { WaveFrontServiceImpl } from './services/wavefrontService.ts'; async function main() { const app = new Application(); const kv = await Deno.openKv(); const fileService = new DenoKVFileService(kv); const waveFrontService = new WaveFrontServiceImpl(); const router = new Router({ prefix: '/v1' }); app.use(oakCors({ origin: /^.+localhost:7766$/ })); app.use( buildAPI(router, fileService, waveFrontService).routes(), ); await app.listen({ port: 9000 }); } await main();