Initial commit: Apothecary v0.4.0
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import cors from "cors";
|
||||
import express from "express";
|
||||
import { seedIfEmpty } from "./seed.js";
|
||||
import { bootstrapRouter } from "./routes/bootstrap.js";
|
||||
import { productsRouter } from "./routes/products.js";
|
||||
import { catalogRouter } from "./routes/catalog.js";
|
||||
|
||||
seedIfEmpty();
|
||||
|
||||
const app = express();
|
||||
app.use(cors());
|
||||
app.use(express.json({ limit: "1mb" }));
|
||||
|
||||
app.use("/api", bootstrapRouter);
|
||||
app.use("/api", productsRouter);
|
||||
app.use("/api", catalogRouter);
|
||||
|
||||
const PORT = Number(process.env.PORT ?? 4000);
|
||||
app.listen(PORT, () => {
|
||||
console.log(`[apothecary] api listening on http://localhost:${PORT}`);
|
||||
});
|
||||
Reference in New Issue
Block a user