-
Notifications
You must be signed in to change notification settings - Fork 0
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: routing #119
base: main
Are you sure you want to change the base?
refactor: routing #119
Conversation
todo: use hono or something |
Hello, I've done a first attempt at using Hono for routing, and also have attempted to take this chance to deal with the trailing slash problem. Additionally, I had run into an issue during testing, which although is unlikely to happen in practice, I believe is worth mentioning and also has a fix. (Another small thing I wanted to mention was that for my PC's version of Deno, v2.1.4, the sqlite in deps.ts would need to be upgraded to v3.9.1 to work correctly, but I have not committed this change yet, since this might not be the same for the platform we ultimately host ProgComp on.) Please let me know if there's anything I can improve/fix in my commit, and if it also works as intended on your platforms too. Thanks! |
The trailing slash issue is because of permanent redirects (301) that Hono uses. I think we should leave off trailing slashes on the API, they tend to work better when serving authored HTML content. Where they are used (stripped index.html for clients), they must only be enforced with 302 (non-permanent) instead of 301. Annoyingly, Hono does not allow for easy configuration of this so we'll require a semi-DIY solution. The other thing that needs to change is mixing and matching trailing slashes for the 'same' path. Wrt Sqlite, if it needs to be updated then go ahead (if you're fussed, then in an individual Thanks for getting to this though. I really ought to sit down and consolidate the design now that I can pour over the original work with some distance now that it's been a so long since we built it. |
You'll probably also want to rebase on main to avoid the current conflicts. |
Thanks for the information, Oli, I did not realise it was the 301s causing the problem. I have implemented a custom middleware to do the same thing as |
No description provided.