Skip to content

Commit

Permalink
fix(admin): serve index.html by default
Browse files Browse the repository at this point in the history
  • Loading branch information
emirotin committed Aug 29, 2018
1 parent 8449568 commit d878381
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/admin/back/src/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ httpProxy.proxy('/api/', {

app.use(express.static(path.join(__dirname, '../static')))

app.get(/^(?!\/api.*$).*/i, (req, res) => {
res.sendFile(path.join(__dirname, '../static/index.html'))
})

app.listen(process.env.PORT || config.port, () => {
console.log(`Started on port ${app.server.address().port}`)
})

0 comments on commit d878381

Please sign in to comment.