-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
50 lines (46 loc) · 1.45 KB
/
index.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import constants from '../../constants';
const IS_PRODUCTION = constants.ENV === 'production';
function processRequest(req, res) {
const response = `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style type="text/css">
html, body {
background-color: #000;
background: linear-gradient(90deg, rgba(30,30,30,1) 0%, rgba(0,0,0,1) 20%, rgba(0,0,0,1) 80%, rgba(30,30,30,1) 100%);
color: #FFF;
font-family: 'Abel', Helvetica, sans-serif;
margin: 0;
}
#app {
max-width: 800px;
margin: 0 auto;
min-height: 100vh;
}
</style>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Abel:300,400,500">
${IS_PRODUCTION ? (`
<link rel="stylesheet" type="text/css" href="/client-${__GIT_SHA__}.css">
`) : ''}
</head>
<body>
<div id="app"></div>
${IS_PRODUCTION ? (`
<script src="/client-${__GIT_SHA__}.js"></script>
`) : `
<script crossorigin src="http://0.0.0.0:8080/client.js"></script>
`}
<script type="text/javascript">
window.__INIT__();
</script>
</body>
</html>
`;
return res.send(response);
}
export default function () {
this.get('*', processRequest);
}