-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
31 lines (23 loc) · 918 Bytes
/
app.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
30
31
(() => {
const express = require('express'),
ip = require('ip'),
app = express(),
path = require('path'),
chalk = require('chalk'),
PORT = process.env.PORT || 600;
app.use('/', express.static(path.join(__dirname, 'app/src')));
// handle every other route with index.html, which will contain
// a script tag to your application's JavaScript file(s).
app.all('*', function (request, response) {
response.sendFile(path.resolve(__dirname, './app/src/index.html'));
});
app.listen(PORT, () => {
console.log(`
Server ready to serve,You Can access it:
------------------------------------
External: ${chalk.blueBright(`http://${ip.address()}:${PORT}`)}
Local: ${chalk.blueBright(`http://localhost:${PORT}`)}
------------------------------------
`);
});
})();