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