Commit Graph
4 Commits
Author SHA1 Message Date
Matt Godbolt 20048616da Migrate to express 5 (#7572)
Main changes:
- type checker cares about the return value (`void`) of handlers, so no
more `return res.send("...")` as that returns `express` type.
- regexes on slugs no longer supported, but we weren't really using them
in any meaningful way. The two places that had to be updated:
- `/clientstate/:clientstate64` - now uses a regex directly and tests added (thanks @partouf for spotting #4844)
- `/bits/:bits.html` - was some `\w+` but I believe that's unnecessary
for the same reasons
- actually call the Sentry handler. I don't know if this actually worked
before but the API checks suggest not.
2025-04-19 14:34:41 -05:00
Mats Jun Larsen 09adb2795a Add re-usable middleware functions to http server (#7154)
Just add the headers you want to the handler list :)

It's basically the addStaticHeaders function again, but this time more
composable. End goal is to replace that function and all its uses with
this as I go with the api improvements

This technically also fixes a cors regression from earlier patches
2024-11-30 11:37:57 +09:00
Mats Jun Larsen b29a0809ad Introduce HttpController interface for http routers (#7142)
By requiring controllers to declare their own routes, we ensure
consistency between tests and the actual server
2024-11-29 00:12:06 +09:00
Mats Jun Larsen 52e27d5a37 Rewrite assembly documentation handler to controller form (#7130)
Follow-up to #7090
2024-11-28 22:39:10 +09:00