Skip to content

Commit

Permalink
update server.js for a single dyno support, this does not scale
Browse files Browse the repository at this point in the history
  • Loading branch information
SNathJr committed Aug 12, 2019
1 parent 9eef72e commit 078dba9
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
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(function (ghostServer) {
////////////////////////////////////////////////////////////////
// this is what you need to get subdirectories working properly!
// e.g. https://www.website.com/blog
parentApp.use(urlService.utils.getSubdir(), ghostServer.rootApp);
ghostServer.start(parentApp);
////////////////////////////////////////////////////////////////
})
.then( ghostServer => ghostServer.start() )
.catch( error => {
console.error(`Ghost server error: ${error.message} ${error.stack}`);
process.exit(1);
});
});

0 comments on commit 078dba9

Please sign in to comment.