Install any skill in seconds. Free to start, no credit card required.
Get Started Free →webiny/webiny-http-route
Adding custom HTTP routes to the API using Api.Route and Route.Interface.
Passed 24 of 24 test cases with the skill, and 8 of 24 without it.
and 24 more in the full report
16 fixed8 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 16 test cases the skill fixed. Same model, same prompt, with and without the skill.
When exporting a custom HTTP route handler implementation from `/extensions/MyRoute.ts` in Webiny, should I use a named export or default export? Provide the export statement.
| Checked | Without skill | With skill |
|---|---|---|
| The file uses default export for HttpRouteHandler.createImplementation. | Missed | Passed |
The instructions your model reads when the skill loads.
Write a handler that implements HttpRouteHandler.Interface, then point <Api.Route> at it in
webiny.config.tsx. The method and path props configure both the API Gateway route and the
router, so the handler file never restates them. Handlers get full DI.
YOU MUST include the full file path with the .ts extension in the src prop. Use
src={"/extensions/MyRoute.ts"}, not src={"/extensions/MyRoute"}. Omitting it fails the build.
YOU MUST use export default for the createImplementation() call. Named exports fail here.
// extensions/MyRoute.ts
import { HttpRouteHandler, Logger } from "webiny/api";
class MyRouteImpl implements HttpRouteHandler.Interface {
constructor(private logger: Logger.Interface) {}
async handle(request: HttpRouteHandler.Request, response: HttpRouteHandler.Response) {
this.logger.info({ path: request.path }, "Handling request");
return response.status(200).json({ status: "ok" });
}
}
export default HttpRouteHandler.createImplementation({
implementation: MyRouteImpl,
dependencies: [Logger]
});
Register it:
<Api.Route method={"POST"} path={"/my-route"} src={"/extensions/MyRoute.ts"} />
test cases passed, vs 8 / 24 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.