DenReg/registry/src/http.ts
Fabian Stamm 7fcdf2c383
Some checks failed
continuous-integration/drone/push Build is failing
Further progress on registry UI.
Add package README view support and style adjustments
2020-07-31 20:16:12 +02:00

30 lines
665 B
TypeScript

/// <reference path="./types/jsx.d.ts" />
import { ABC, CorsMW, LoggerMW } from "./deps.ts";
import config from "./config.ts";
const port = config?.api?.port || 8000;
const app = new ABC.Application();
app.use(LoggerMW.logger({}));
app.use(CorsMW.cors({}));
import api from "./http/api.ts";
api(app.group("/api"));
import raw from "./http/raw.ts";
raw(app.group("/raw"));
import view from "./http/views.ts";
view(app);
console.log(app.router.trees.GET);
import render from "./renderer.tsx";
app.renderer = {
render: render,
};
app.start({ port });
console.log("Running server at http://0.0.0.0:" + port);
console.log("Open at http://127.0.0.1:" + port);