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

Implement a routing library #14

Open
whoabuddy opened this issue Dec 12, 2024 · 1 comment
Open

Implement a routing library #14

whoabuddy opened this issue Dec 12, 2024 · 1 comment

Comments

@whoabuddy
Copy link
Contributor

Right now we are manually routing the endpoints to functions with string matching. This works but could get messy as things grow.

We should look into a routing library that maintains the same clean, simple structure we're using now. I think itty-router would be a good fit but def needs some testing and high-level thought. Open to feedback.

@whoabuddy
Copy link
Contributor Author

For now I've split the database file into handlers, where the durable object passes the request to the handler and it iterates over its endpoint operations in a switch statement. It's still a simple implementation but helps break things up to make them easier to read.

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

No branches or pull requests

1 participant