0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00
ghost/core/server/middleware
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
validation Error creation (#7477) 2016-10-06 13:27:35 +01:00
cache-control.js deps: grunt-jscs@2.1.0 2015-10-12 19:21:16 +01:00
check-ssl.js 🎨 change how we get and set config 2016-09-20 15:59:34 +01:00
decide-is-admin.js Moves the decideIsAdmin into its own file. 2015-06-09 14:02:22 -07:00
error-handler.js Error creation (#7477) 2016-10-06 13:27:35 +01:00
ghost-locals.js Misc Middleware cleanup (#7526) 2016-10-10 21:14:32 +02:00
index.js 🎉 Middleware refactor: Give the API its own express App (#7537) 2016-10-11 10:36:00 +02:00
labs.js 🎨 configurable logging with bunyan (#7431) 2016-10-04 16:33:43 +01:00
maintenance.js Error creation (#7477) 2016-10-06 13:27:35 +01:00
pretty-urls.js Misc Middleware cleanup (#7526) 2016-10-10 21:14:32 +02:00
redirect-to-setup.js Ghost OAuth (#7451) 2016-09-30 12:45:59 +01:00
serve-shared-file.js 🎨 change how we get and set config 2016-09-20 15:59:34 +01:00
static-theme.js 🎨 🔦 refactor content paths (images, apps, themes, storage, scheduling) 2016-09-20 15:59:34 +01:00
theme-handler.js Misc Middleware cleanup (#7526) 2016-10-10 21:14:32 +02:00
uncapitalise.js Misc Middleware cleanup (#7526) 2016-10-10 21:14:32 +02:00