Skip to content

Commit ec9a565

Browse files
committed
Fix ssr for / route
When / route is requested, index.html is immediately served.
1 parent 49d70d4 commit ec9a565

File tree

7 files changed

+6
-9
lines changed

7 files changed

+6
-9
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.

public/index.html

+2-5
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,12 @@
55
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
77
<meta name="theme-color" content="#000000" />
8-
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo_croogo.png" />
8+
<link rel="apple-touch-icon" href="%PUBLIC_URL%/img/logo_croogo.png" />
99
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
1010
<helmet/>
1111
</head>
1212
<body>
13-
<noscript>You need to enable JavaScript to run this app.</noscript>
14-
<script>
15-
window.__USE_API_CACHE__ = '[]'
16-
</script>
1713
<div id="root"></div>
14+
<noscript>You need to enable JavaScript to run this app.</noscript>
1815
</body>
1916
</html>

public/logo_croogo.png

-8.19 KB
Binary file not shown.

public/manifest.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
"name": "Croogo - The CakePHP Powered Content Management System",
44
"icons": [
55
{
6-
"src": "favicon.ico",
6+
"src": "img/favicon.ico",
77
"sizes": "200x200",
88
"type": "image/x-icon"
99
},
1010
{
11-
"src": "logo192.png",
11+
"src": "img/logo192.png",
1212
"type": "image/png",
1313
"sizes": "192x192"
1414
},
1515
{
16-
"src": "logo512.png",
16+
"src": "img/logo512.png",
1717
"type": "image/png",
1818
"sizes": "512x512"
1919
}

server/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import ServerRenderer from './ServerRenderer';
99
const PORT = process.env.PORT || 3006;
1010
const app = express();
1111

12-
app.use(express.static('./build'));
12+
app.use(express.static('./build', { index: false }));
1313

1414
app.get('/*', async (req: Request, res: Response) => {
1515
const context: StaticRouterContext = {};

0 commit comments

Comments
 (0)