Ghost/core/server/api/shared
Kukhyeon Heo 5715aa2155
Added .yaml format support in redirects configuration (#12187)
closes #11085

- Ghost has been using YAML format for other configurations (e.g. routes). The plan is to move to this format for all user-edited settings files. By default JSON format is still used in Ghost Admin API v2/v3, but will be changed to YAML in API v4. Check referenced issue for more context.
- New format supports all the features available before. The main noticeable change is the structure of config file. It is now grouped by redirect HTTP code instead of specifying `"permanent": true | false` attribute for each config property. Example format for YAML config:
```
302:
  /from-url/: /to-url/

301:
  /category/([a-z0-9\-]+)/i: /tag/$1/
  /v([0-9\.]+)/docs/([a-z0-9\-]+)/i: /docs/$2/
```
- Added 2 new endpoints: `POST redirects/upload` and `GET redirects/download`. These serve as an alias to current GET/POST `/redirects/json. "upload/download" naming pattern is introduced to match the convention with other resources that can be uploaded and downloaded (images, themes etc.). `/redirects/json`  endpoints will be removed in Admin API v4
- The parsing code from `custom-redirects.js` has been moved to `frontend/services/redirects/settings.js`. This location is more appropriate for this logic and eventually `custom-redirects.js` middlewear might be moved into "frontend" as this middlewear plays a role mostly effecting that area.
2020-11-04 12:08:32 +13:00
..
serializers Extracted promise libs and history into @tryghost/promise 2020-08-11 18:44:21 +01:00
utils Added comments for Ghost API 2019-05-06 14:49:25 +02:00
validators Fixed "no-shadow" linting error in server modules (#12287) 2020-10-20 12:02:56 +13:00
frame.js Update Test & linting packages (major) (#10858) 2019-07-05 13:40:43 +02:00
headers.js Added Location header to API's POST request responses (#12186) 2020-09-14 22:33:37 +12:00
http.js Added .yaml format support in redirects configuration (#12187) 2020-11-04 12:08:32 +13:00
index.js Added tiny framework to support multiple API versions (#9933) 2018-10-05 00:50:45 +02:00
pipeline.js Extracted promise libs and history into @tryghost/promise 2020-08-11 18:44:21 +01:00