19 lines
460 B
TypeScript
19 lines
460 B
TypeScript
|
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"));
|
||
|
|
||
|
app.start({ port });
|
||
|
console.log("Running server at http://0.0.0.0:" + port);
|
||
|
console.log("Open at http://127.0.0.1:" + port);
|