Skip to content
Permalink
Browse files
Fix waiting for launched server
  • Loading branch information
raphinesse committed Sep 8, 2018
1 parent f41b829 commit 36ce5a5e47b91032df208a2f45a11d3700cc9127
Showing 1 changed file with 7 additions and 6 deletions.
@@ -143,14 +143,15 @@ function registerRoutes (app) {
function serve (port) {
return Promise.resolve().then(() => {
port = +port || 8000;
const server = cordovaServe();

// Run a prepare first!
return require('./cordova').prepare([]).then(() => {
const server = cordovaServe();
registerRoutes(server.app);
server.launchServer({ port, events });
return server.server;
});
return require('./cordova').prepare([])
.then(() => {
registerRoutes(server.app);
return server.launchServer({ port, events });
})
.then(() => server.server);
});
}

0 comments on commit 36ce5a5

Please sign in to comment.