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 96e1db8509 Introduce jsonOnly middleware for requiring JSON content type 2025-02-01 02:05:03 +09:00
Mats Jun Larsen bcd6394435 Ensure that content type for formatting requests is JSON (#7327)
Ideally I'd add a middleware or something else that requires JSON, but I
suppose this is fine for now.

cc @dkm
2025-01-29 10:46:56 -06:00
Mats Jun Larsen fba4ba672a De-couple formatter from http server (#7155)
This patch decouples the formatting logic (which is used by the
clang-format feature) from the http API logic.

This is done with the new FormattingService populates the formatters
from the config, and wraps formatter execution. This way, both the http
controller and the clang-format functionality can use it, reducing tight
coupling.
2024-11-30 12:14:11 +09:00