Added frontend routing hack
This commit is contained in:
22
build/404.html
Normal file
22
build/404.html
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Chess Board Consumer</title>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var segmentCount = 1;
|
||||||
|
|
||||||
|
var l = window.location;
|
||||||
|
l.replace(
|
||||||
|
l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') +
|
||||||
|
l.pathname.split('/').slice(0, 1 + segmentCount).join('/') + '/?p=/' +
|
||||||
|
l.pathname.slice(1).split('/').slice(segmentCount).join('/').replace(/&/g, '~and~') +
|
||||||
|
(l.search ? '&q=' + l.search.slice(1).replace(/&/g, '~and~') : '') +
|
||||||
|
l.hash
|
||||||
|
);
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
22
public/404.html
Normal file
22
public/404.html
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Chess Board Consumer</title>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var segmentCount = 1;
|
||||||
|
|
||||||
|
var l = window.location;
|
||||||
|
l.replace(
|
||||||
|
l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') +
|
||||||
|
l.pathname.split('/').slice(0, 1 + segmentCount).join('/') + '/?p=/' +
|
||||||
|
l.pathname.slice(1).split('/').slice(segmentCount).join('/').replace(/&/g, '~and~') +
|
||||||
|
(l.search ? '&q=' + l.search.slice(1).replace(/&/g, '~and~') : '') +
|
||||||
|
l.hash
|
||||||
|
);
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -15,15 +15,26 @@
|
|||||||
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
||||||
-->
|
-->
|
||||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
||||||
<!--
|
<!-- Start Single Page Apps for GitHub Pages -->
|
||||||
Notice the use of %PUBLIC_URL% in the tags above.
|
<script type="text/javascript">
|
||||||
It will be replaced with the URL of the `public` folder during the build.
|
(function(l) {
|
||||||
Only files inside the `public` folder can be referenced from the HTML.
|
if (l.search) {
|
||||||
|
var q = {};
|
||||||
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
l.search.slice(1).split('&').forEach(function(v) {
|
||||||
work correctly both with client-side routing and a non-root public URL.
|
var a = v.split('=');
|
||||||
Learn how to configure a non-root public URL by running `npm run build`.
|
q[a[0]] = a.slice(1).join('=').replace(/~and~/g, '&');
|
||||||
-->
|
});
|
||||||
|
if (q.p !== undefined) {
|
||||||
|
window.history.replaceState(null, null,
|
||||||
|
l.pathname.slice(0, -1) + (q.p || '') +
|
||||||
|
(q.q ? ('?' + q.q) : '') +
|
||||||
|
l.hash
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}(window.location))
|
||||||
|
</script>
|
||||||
|
<!-- End Single Page Apps for GitHub Pages -->
|
||||||
<title>React App</title>
|
<title>React App</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
Reference in New Issue
Block a user