0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00
ghost/core/server/web/api
kirrg001 079b41e608 Added body parser to web/api/v2 express app
refs #9866

- req.body is undefined if we don't use the body parser
- the content API only offers "fetch" endpoints, but if a component/module in Ghost relies on req.body being present, it can crash
- e.g. the authentication service checks for the existence of client_id + client_secret in req.query or req.body
- we could theoretically change it from `if (!req.body.client_id` to `if (req.body && !req.body.client_id)`, but that makes the code very hard to read + maintain
- we will use the body parser for the content API now
- req.body will be {}
2018-10-03 00:47:03 +02:00
..
v0.1 Added new endpoint to upload square profile images with dimension validation (#9862) 2018-09-24 21:42:58 +02:00
v2 Added body parser to web/api/v2 express app 2018-10-03 00:47:03 +02:00
README.md Added v2 api endpoints (#9874) 2018-09-18 15:59:06 +02:00

Ghost APIs

Ghost is moving towards providing more robust APIs in the future. A plan and decisions can be found here.

WARNING!

The v2 API (/ghost/api/v2/* endpoints) is to be considered under active development until this message is removed. Please use with caution and don't rely too heavy on it just yet :)