Type editor and schema viewer. Poppables and help icon

This commit is contained in:
Emma
2023-06-11 10:25:32 -06:00
parent 42c0004150
commit b951d1970d
36 changed files with 1190 additions and 77 deletions

View File

@@ -0,0 +1,24 @@
import { CGGService } from 'cgg/Application.ts';
import { Router, send } from 'oak';
const app = new CGGService({ prefix: '/' });
// app.route(new Router()
// .get('/', ctx => ctx.response.body = 'warstone-web service')
// );
const ROOT_DIR = "./public/testdata", ROOT_DIR_PATH = "/public";
app.use(async (ctx, next) => {
if (!ctx.request.url.pathname.startsWith(ROOT_DIR_PATH)) {
next();
return;
}
const filePath = ctx.request.url.pathname.replace(ROOT_DIR_PATH, "");
await send(ctx, filePath, {
root: ROOT_DIR,
});
});
app.start();
console.log('warstone-web service running on ' + Deno.args.at(0));