Ghost/core/server/web/shared/middleware
Naz 9c64d7af81 Centralized base API path value across server codebase
refs https://github.com/TryGhost/Team/issues/1420

- This changeset makes the "/ghost/api" base path for the APIs centralized in one place and reused by dependent modules. There are couple benefits this refactor brings: easy way to spot where the API base path is used (was hard to find it in regexp) and makes it easy to change the hardcoded path to a configurable one in the future (e.g. host all APIs under `domain.tld/custom-path/awesome-apis/posts`)
- I hear that scream from the back of your head: "But hey! This introduced coupling to url-utils!". To that my unswer is: "No. This change only makes the coupling explicit, it's been there already and now can be addressed if we need to!".
- A neat thing about his change, making the API work on a custom path is one line away, by moving the hardcoded `/ghost/api` to a config ;)
2022-03-09 17:15:51 +08:00
..
api Renamed middlewares to middleware consistently 2021-11-16 15:51:47 +00:00
brute.js Renamed middlewares to middleware consistently 2021-11-16 15:51:47 +00:00
cache-control.js Added JSDoc to cache control middleware 2022-01-14 14:04:23 +02:00
index.js Replace error handler middleware with @tryghost/mw-error-handler (#13879) 2021-12-14 15:18:46 +00:00
pretty-urls.js Renamed middlewares to middleware consistently 2021-11-16 15:51:47 +00:00
uncapitalise.js Centralized base API path value across server codebase 2022-03-09 17:15:51 +08:00
url-redirects.js Renamed middlewares to middleware consistently 2021-11-16 15:51:47 +00:00