const koa = require("koa");
const bodyParser = require("koa-bodyparser");
const path = require("path");
const koaStatic = require("koa-static")

const routes = require("./routes/routes");
const indexRoutes = require("./routes/index");
const db = require("./db")

const app = new koa();

app.use(bodyParser());

app.use(routes.routes());
app.use(routes.allowedMethods());

app.use(koaStatic(path.join(__dirname, "public")));

const port = 3000;
app.listen(port, () => {
    console.log(`Server is running on http://localhost:${port}`);
})
