From 9e2a79f8e436a621051e21a8b5f686c44d809f06 Mon Sep 17 00:00:00 2001 From: Lee <55973914+PeterAlfredLee@users.noreply.github.com> Date: Mon, 17 May 2021 16:01:55 +0800 Subject: [PATCH] docs: update history mode example (#949) --- docs/guide/essentials/history-mode.md | 12 +++++++++--- docs/zh/guide/essentials/history-mode.md | 12 +++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/docs/guide/essentials/history-mode.md b/docs/guide/essentials/history-mode.md index b75f0d4c..006723a8 100644 --- a/docs/guide/essentials/history-mode.md +++ b/docs/guide/essentials/history-mode.md @@ -76,9 +76,9 @@ const httpPort = 80 http .createServer((req, res) => { - fs.readFile('index.htm', 'utf-8', (err, content) => { + fs.readFile('index.html', 'utf-8', (err, content) => { if (err) { - console.log('We cannot open "index.htm" file.') + console.log('We cannot open "index.html" file.') } res.writeHead(200, { @@ -122,7 +122,13 @@ For Node.js/Express, consider using [connect-history-api-fallback middleware](ht ``` -### Caddy +### Caddy v2 + +``` +try_files {path} / +``` + +### Caddy v1 ``` rewrite { diff --git a/docs/zh/guide/essentials/history-mode.md b/docs/zh/guide/essentials/history-mode.md index b2f2844f..12a39422 100644 --- a/docs/zh/guide/essentials/history-mode.md +++ b/docs/zh/guide/essentials/history-mode.md @@ -76,9 +76,9 @@ const httpPort = 80 http .createServer((req, res) => { - fs.readFile('index.htm', 'utf-8', (err, content) => { + fs.readFile('index.html', 'utf-8', (err, content) => { if (err) { - console.log('We cannot open "index.htm" file.') + console.log('We cannot open "index.html" file.') } res.writeHead(200, { @@ -122,7 +122,13 @@ http ``` -### Caddy +### Caddy v2 + +``` +try_files {path} / +``` + +### Caddy v1 ``` rewrite { -- 2.47.2