migrate to monorepo?

This commit is contained in:
2025-12-13 20:20:48 -05:00
parent 7da6408d7a
commit a66b5b2362
29 changed files with 849 additions and 817 deletions

View File

@@ -0,0 +1,30 @@
import { statusRoute } from "./routes/status";
import { kijijiRoute } from "./routes/kijiji";
import { facebookRoute } from "./routes/facebook";
import { ebayRoute } from "./routes/ebay";
const PORT = process.env.PORT || 4005;
const server = Bun.serve({
port: PORT as number | string,
idleTimeout: 0,
routes: {
// Health check endpoint
"/api/status": statusRoute,
// Marketplace search endpoints
"/api/kijiji": kijijiRoute,
"/api/facebook": facebookRoute,
"/api/ebay": ebayRoute,
// Fallback for unmatched /api routes
"/api/*": Response.json({ message: "Not found" }, { status: 404 }),
},
// Fallback for all other routes
fetch(req: Request) {
return new Response("Not Found", { status: 404 });
},
});
console.log(`API Server running on ${server.hostname}:${server.port}`);