mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-27 05:44:17 +03:00
Handle 404 response for content.json with page render.
This commit is contained in:
parent
f4197dd840
commit
f890a48653
2
examples/docs/static/hmr.js
vendored
2
examples/docs/static/hmr.js
vendored
@ -69,7 +69,7 @@ function fetchContentJsonForCurrentPage() {
|
|||||||
const contentJsonForPage = await fetch(
|
const contentJsonForPage = await fetch(
|
||||||
`${window.location.origin}${currentPath}content.json`
|
`${window.location.origin}${currentPath}content.json`
|
||||||
);
|
);
|
||||||
if (contentJsonForPage.ok) {
|
if (contentJsonForPage.ok || contentJsonForPage.status === 404) {
|
||||||
resolve(await contentJsonForPage.json());
|
resolve(await contentJsonForPage.json());
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
|
@ -69,7 +69,7 @@ function fetchContentJsonForCurrentPage() {
|
|||||||
const contentJsonForPage = await fetch(
|
const contentJsonForPage = await fetch(
|
||||||
`${window.location.origin}${currentPath}content.json`
|
`${window.location.origin}${currentPath}content.json`
|
||||||
);
|
);
|
||||||
if (contentJsonForPage.ok) {
|
if (contentJsonForPage.ok || contentJsonForPage.status === 404) {
|
||||||
resolve(await contentJsonForPage.json());
|
resolve(await contentJsonForPage.json());
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
|
Loading…
Reference in New Issue
Block a user