Skip to content

Commit

Permalink
add support for subdirs @cancan101
Browse files Browse the repository at this point in the history
  • Loading branch information
SNathJr committed Aug 14, 2019
1 parent 0fc25d7 commit ccef87e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
var ghost = require('ghost');
var express = require('express');
var urlService = require('./node_modules/ghost/core/server/services/url');
var parentApp = express();

// Run a single Ghost process
ghost()
.then( ghostServer => ghostServer.start() )
.then( ghostServer => {
// this is what you need to get subdirectories working properly!
parentApp.use(urlService.utils.getSubdir(), ghostServer.rootApp);
ghostServer.start(parentApp);
})
.catch( error => {
console.error(`Ghost server error: ${error.message} ${error.stack}`);
process.exit(1);
Expand Down

0 comments on commit ccef87e

Please sign in to comment.