app.post("/api/orders", async (c) => {
try {
const body = await c.req.json();
const response = await fetch("http://xx.xxx.xx.xxx/orders", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(body)
});
// ... handle response
} catch (error) {
return c.json({ error: 'Failed to process order' }, 500);
}
});
app.post("/api/orders", async (c) => {
try {
const body = await c.req.json();
const response = await fetch("http://xx.xxx.xx.xxx/orders", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(body)
});
// ... handle response
} catch (error) {
return c.json({ error: 'Failed to process order' }, 500);
}
});