feat(convex): add implementation rules and configuration for backend functions
- Introduced a comprehensive markdown document outlining implementation rules for Convex functions, including syntax, registration, HTTP endpoints, and TypeScript usage. - Created a new configuration file for the Convex app, integrating the Resend service. - Added a new HTTP route for handling Shippo webhooks to ensure proper response handling. - Implemented integration tests for order timeline events, covering various scenarios including order fulfillment and status changes. - Enhanced existing functions with type safety improvements and additional validation logic. This commit establishes clear guidelines for backend development and improves the overall structure and reliability of the Convex application.
This commit is contained in:
@@ -134,4 +134,16 @@ http.route({
|
||||
}),
|
||||
});
|
||||
|
||||
http.route({
|
||||
path: "/shippo/webhook",
|
||||
method: "POST",
|
||||
handler: httpAction(async (ctx, request) => {
|
||||
const body = await request.text();
|
||||
// Always respond 200 first — Shippo retries on non-2xx, so we must not
|
||||
// let internal errors cause retry storms. Errors are logged in the action.
|
||||
await ctx.runAction(internal.shippoWebhook.handleTrackUpdated, { body });
|
||||
return new Response(null, { status: 200 });
|
||||
}),
|
||||
});
|
||||
|
||||
export default http;
|
||||
Reference in New Issue
Block a user