forked from zendesk/zopim-chat-web-sdk-sample-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
web.js
29 lines (24 loc) · 688 Bytes
/
web.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*eslint no-console:0 */
const express = require('express')
const path = require('path')
const chalk = require('chalk')
const compression = require('compression')
console.log(chalk.blue('Testing release build'))
const app = express()
app.use(compression())
app.use(express.static(path.resolve(__dirname, './dist')))
app.get('*', (req, res) => {
res.sendFile(path.resolve(__dirname, './dist/index.html'))
})
const port = process.env.PORT || 8080
app.listen(port, err => {
if (err) console.log(chalk.red(err))
else
console.log(
chalk.green(
`Production server is running on http://localhost${
port !== 80 ? ':' + port : ''
}`
)
)
})