Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(create-pages): dynamic handlers and static handler #1147

Merged
merged 2 commits into from
Jan 13, 2025

Conversation

tylersayshi
Copy link
Contributor

refactor createApi to support multiple handlers on dynamic route with single createApi call

this also enforces with types static paths only have a single handler

Copy link

vercel bot commented Jan 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
waku ✅ Ready (Inspect) Visit Preview Jan 13, 2025 7:31am

Copy link

codesandbox-ci bot commented Jan 13, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

method: Method;
handler: (req: Request) => Promise<Response>;
path: Path;
handlers: Partial<Record<Method, ApiHandler>>;
Copy link
Owner

Choose a reason for hiding this comment

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

Why do you want Partial?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this example explains it better than I can with words

https://tsplay.dev/wOgPpw

Copy link
Owner

Choose a reason for hiding this comment

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

Oh, yeah. I miss that...

@dai-shi dai-shi merged commit 00a5065 into dai-shi:main Jan 13, 2025
26 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.

2 participants