Skip to content

Commit 9e2a79f

Browse files
docs: update history mode example (vuejs#949)
1 parent 6eebea7 commit 9e2a79f

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

docs/guide/essentials/history-mode.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ const httpPort = 80
7676

7777
http
7878
.createServer((req, res) => {
79-
fs.readFile('index.htm', 'utf-8', (err, content) => {
79+
fs.readFile('index.html', 'utf-8', (err, content) => {
8080
if (err) {
81-
console.log('We cannot open "index.htm" file.')
81+
console.log('We cannot open "index.html" file.')
8282
}
8383

8484
res.writeHead(200, {
@@ -122,7 +122,13 @@ For Node.js/Express, consider using [connect-history-api-fallback middleware](ht
122122
</configuration>
123123
```
124124

125-
### Caddy
125+
### Caddy v2
126+
127+
```
128+
try_files {path} /
129+
```
130+
131+
### Caddy v1
126132

127133
```
128134
rewrite {

docs/zh/guide/essentials/history-mode.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ const httpPort = 80
7676

7777
http
7878
.createServer((req, res) => {
79-
fs.readFile('index.htm', 'utf-8', (err, content) => {
79+
fs.readFile('index.html', 'utf-8', (err, content) => {
8080
if (err) {
81-
console.log('We cannot open "index.htm" file.')
81+
console.log('We cannot open "index.html" file.')
8282
}
8383

8484
res.writeHead(200, {
@@ -122,7 +122,13 @@ http
122122
</configuration>
123123
```
124124

125-
### Caddy
125+
### Caddy v2
126+
127+
```
128+
try_files {path} /
129+
```
130+
131+
### Caddy v1
126132

127133
```
128134
rewrite {

0 commit comments

Comments
 (0)