Closed abtestingalpha closed 2 months ago
The changes involve the addition of middleware for the /api-docs
route in the packages/rest-api/src/app.ts
file. This new middleware sets HTTP cache control headers to prevent caching of responses. It is positioned before the existing Swagger UI serving functions, ensuring that control is passed to the next middleware after setting the headers.
File | Change Summary |
---|---|
packages/rest-api/src/app.ts | Added middleware for /api-docs route to set HTTP cache control headers. |
In the garden where APIs play,
A rabbit hops with joy today.
Middleware sprouted, headers set,
No caching troubles, no regret!
Hooray for docs, so clear and bright,
Our Swagger shines, a lovely sight! 🐇✨
packages/rest-api/src/app.ts (1)
`12-26`: **LGTM!** The middleware function is setting the cache control headers correctly and comprehensively to prevent caching of the `/api-docs` route. The placement of the middleware before the Swagger UI middleware ensures that the cache control headers are set before the response is sent.
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 37.95009%. Comparing base (
49cf94d
) to head (191f7f3
). Report is 7 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Latest commit: |
191f7f3
|
Status: | ✅ Deploy successful! |
Preview URL: | https://ace88974.sanguine-fe.pages.dev |
Branch Preview URL: | https://rest-api-no-cache.sanguine-fe.pages.dev |
Description Ensures fresh docs on each
/api-docs
visit.Summary by CodeRabbit
/api-docs
route to manage HTTP cache control headers, ensuring up-to-date API documentation delivery.