Skip to content

Commit a3d0c05

Browse files
AlexandreBonaventureAkryum
authored andcommitted
feat: Wait for initial compile (#39), fixes #38
* await * return ready promise
1 parent ec61b65 commit a3d0c05

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ module.exports = (app, options) => {
140140
}
141141
ssr(req, res)
142142
})
143+
return readyPromise
143144
} catch (e) {
144145
console.error(e)
145146
}

lib/server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ exports.createServer = ({
55
port,
66
host,
77
}) => {
8-
return new Promise((resolve, reject) => {
8+
return new Promise(async (resolve, reject) => {
99
const app = express()
1010

11-
applyApp(app)
11+
await applyApp(app)
1212

1313
app.listen(port, host, err => {
1414
if (err) {

0 commit comments

Comments
 (0)