]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
docs: update history mode example (#949)
authorLee <55973914+PeterAlfredLee@users.noreply.github.com>
Mon, 17 May 2021 08:01:55 +0000 (16:01 +0800)
committerGitHub <noreply@github.com>
Mon, 17 May 2021 08:01:55 +0000 (10:01 +0200)
docs/guide/essentials/history-mode.md
docs/zh/guide/essentials/history-mode.md

index b75f0d4cee63bb65d68d0abff78345112b502ba4..006723a872f5be78518f7a62658d1435d1add6b4 100644 (file)
@@ -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
 </configuration>
 ```
 
-### Caddy
+### Caddy v2
+
+```
+try_files {path} /
+```
+
+### Caddy v1
 
 ```
 rewrite {
index b2f2844f1593f6dd2a940423342288ab81945c7b..12a394220bc853735755a0288339ccd55b418cac 100644 (file)
@@ -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
 </configuration>
 ```
 
-### Caddy
+### Caddy v2
+
+```
+try_files {path} /
+```
+
+### Caddy v1
 
 ```
 rewrite {