The current implementation of the get method in axum-js only accepts a string argument for specifying the path. To enhance its functionality and align with common JavaScript/TypeScript practices, it is essential to extend the get method to also accept a callback function. This callback function should be executed when the route is accessed.
The callback function provides a mechanism to handle requests and send responses, enabling more dynamic and interactive API endpoints.
Acceptance Criteria:
Update the get method to accept a callback function as an argument alongside the path string.
Ensure the callback function is executed when the specified route is accessed.
Update any relevant documentation, type definitions, and tests to reflect this change.
Ensure the implementation adheres to the project's STYLE_GUIDE.md and is consistent with existing code patterns.
Create a PR with the necessary code changes, updated documentation, and tests.
Additional Context:
Supporting callbacks is a step towards making axum-js more flexible and user-friendly, aligning with common patterns used in JavaScript and TypeScript-based server frameworks.
The current implementation of the
get
method inaxum-js
only accepts a string argument for specifying the path. To enhance its functionality and align with common JavaScript/TypeScript practices, it is essential to extend theget
method to also accept a callback function. This callback function should be executed when the route is accessed.Currently:
The callback function provides a mechanism to handle requests and send responses, enabling more dynamic and interactive API endpoints.
Acceptance Criteria:
get
method to accept a callback function as an argument alongside the path string.STYLE_GUIDE.md
and is consistent with existing code patterns.Additional Context:
Supporting callbacks is a step towards making
axum-js
more flexible and user-friendly, aligning with common patterns used in JavaScript and TypeScript-based server frameworks.