mirror of
https://github.com/danbulant/koa-plugins
synced 2026-05-20 04:38:38 +00:00
18 lines
No EOL
340 B
JavaScript
18 lines
No EOL
340 B
JavaScript
console.log("[INFO] Starting...");
|
|
|
|
const Koa = require("koa");
|
|
const app = new Koa;
|
|
const Hooks = require("./hooks");
|
|
const hooks = new Hooks;
|
|
|
|
hooks.registerPlugins(app);
|
|
|
|
app.use(async ctx => {
|
|
await hooks.runPlugins(ctx);
|
|
});
|
|
|
|
console.log("Plugins loaded, starting webserver");
|
|
|
|
app.listen(80, ()=>{
|
|
console.log("Web ready");
|
|
}) |