Skip to content

Conversation

@karthik2804
Copy link
Collaborator

This PR restructures the templates so that the default directory structure follows more javascript-ish structure and tucks away knitwit as the user should not have to deal with it usually. It also updates the default HTTP templates to now have a router with a catch-all 404 set up.

Signed-off-by: karthik2804 <[email protected]>
export async function handler(req, res) {
console.log(req);
let router = Router();
router.get("*", (_, req, res) => { handleDefaultRoute(req, res) })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

potential nit that you can ignore: instead of separate functions, lambdas here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a slight preference in this case to use functions as it keeps the router structure easily readable when more are added.

Copy link
Collaborator

@tschneidereit tschneidereit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! I added a few suggestions, but nothing major

Signed-off-by: karthik2804 <[email protected]>
@karthik2804
Copy link
Collaborator Author

@tschneidereit updated to be in line with the suggestions.

Copy link
Collaborator

@tschneidereit tschneidereit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@tschneidereit tschneidereit merged commit 2b7c05d into spinframework:main Jan 21, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants