-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
Description
It would be cool if Ghost could be installed as an npm module, and then used as middleware in any express app. So you could do something like:
var express = require("express");
var ghost = require("ghost");
var app = express();
app.get('/', function(req, res) {
res.send('hello world');
});
var blog = ghost({
contentDirectory: "./ghost-blog-content"
});
app.use(blog.middleware({
urlRoot: "/blog"
}));
app.listen(3000);Notably both the content directory, and the url it is served from are configurable here. It could also be interesting to experiment with allowing the front-end, admin interface and public API to all be served from separate custom locations.
This would allow all sorts of possibilities such as having multiple Ghost blogs in the same server, and embedding ghost as part of a larger CMS product... Obviously this would need to be in addition to it working standalone, but I don't think that would be too difficult to manage (the standalone version could just be a thin wrapper around the middleware version).
Thoughts?