import Koa from "koa"; import Static from "koa-static"; import Router from "@koa/router"; import { resolve } from "path"; import mount from "koa-mount"; const app = new Koa(); const router = new Router(); router.get("/api", (ctx) => { ctx.body = "THIS IS API RESPONSE"; }); app.use(router.routes()); app.use(mount("/", Static(resolve(__dirname, "../public")))); const port = 3000; app.listen(port); console.log(`Listening on 127.0.0.1:${port}`);