0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00
ghost/core/server
Hannah Wolfe 61bf54ec88 🎉 Middleware refactor: Give the API its own express App (#7537)
refs #4172

* 🎨 Use bodyParser only where it is needed

This is a pretty extreme optimisation, however in the interests of killing middleware/index.js it
seemed prudent to move towards not having in there that wasn't strictly necessary 😁

We should reassess how apps do this sort of thing, but it seems pretty sane to declare bodyParsing
if and only if it is necessary.

* 🎨 Move all API code to API router

* 🎨 Refactor API into an App, not just a router

- Apps have their own rendering engines, only the frontend & the admin panel need views
- The API should be JSON only, with minimal middleware
- Individual sections within the API could/should be treated as Routers

* 🎨 Flatten API middleware inclusion

- get rid of the weird middleware object
- move the api-only middleware into the middleware/api folder
2016-10-11 10:36:00 +02:00
..
api 🎉 Middleware refactor: Give the API its own express App (#7537) 2016-10-11 10:36:00 +02:00
apps 🎉 Middleware refactor: Give the API its own express App (#7537) 2016-10-11 10:36:00 +02:00
auth 🎉 Middleware refactor: Give the API its own express App (#7537) 2016-10-11 10:36:00 +02:00
config Misc Middleware cleanup (#7526) 2016-10-10 21:14:32 +02:00
controllers Move internal tags out of labs (#7519) 2016-10-10 09:51:03 +01:00
data Misc Middleware cleanup (#7526) 2016-10-10 21:14:32 +02:00
events post-scheduling 2016-06-14 10:52:13 +02:00
helpers 🔥 Remove the deprecated body classes (#7510) 2016-10-10 11:38:12 +02:00
logging 🐛 logging: always print body of standalone error (#7535) 2016-10-11 07:26:37 +01:00
mail 🎨 change how we get and set config 2016-09-20 15:59:34 +01:00
middleware 🎉 Middleware refactor: Give the API its own express App (#7537) 2016-10-11 10:36:00 +02:00
models Move internal tags out of labs (#7519) 2016-10-10 09:51:03 +01:00
permissions Error creation (#7477) 2016-10-06 13:27:35 +01:00
routes 🎉 Middleware refactor: Give the API its own express App (#7537) 2016-10-11 10:36:00 +02:00
scheduling Error creation (#7477) 2016-10-06 13:27:35 +01:00
storage Error creation (#7477) 2016-10-06 13:27:35 +01:00
translations Migration: New database versioning (#7499) 2016-10-06 14:50:55 +01:00
utils Misc Middleware cleanup (#7526) 2016-10-10 21:14:32 +02:00
views Switch to new native system font stack (#7219) 2016-08-18 20:29:46 +01:00
errors.js 🎨 optimise error to inherit from in GhostError prototype (#7529) 2016-10-10 18:30:30 +01:00
filters.js Misc grunt /dev updates 2015-05-28 20:25:14 +01:00
ghost-server.js Error creation (#7477) 2016-10-06 13:27:35 +01:00
i18n.js improvement: general fixes 2016-06-01 07:07:20 +02:00
index.js Error creation (#7477) 2016-10-06 13:27:35 +01:00
overrides.js 🛠 update lodash,knex and bookshelf to latest versions 2016-09-26 10:20:55 +02:00
update-check.js Misc Middleware cleanup (#7526) 2016-10-10 21:14:32 +02:00