From: Lee <55973914+PeterAlfredLee@users.noreply.github.com> Date: Mon, 17 May 2021 08:01:55 +0000 (+0800) Subject: docs: update history mode example (#949) X-Git-Tag: v4.0.9~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e2a79f8e436a621051e21a8b5f686c44d809f06;p=thirdparty%2Fvuejs%2Frouter.git docs: update history mode example (#949) --- 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 {