// SPDX-License-Identifier: MIT
// Copyright (c) 2024-2026 Acme Corp.

const express = require("express");
const { apiRouter } = require("./routes/api");
const { corsMiddleware } = require("./middleware/cors");

const app = express();
app.use(corsMiddleware);
app.use(express.json());
app.use("/api", apiRouter);

const port = process.env.PORT ?? 3000;
app.listen(port, () => console.log(`server listening on :${port}`));
