File tree Expand file tree Collapse file tree 2 files changed +33
-7
lines changed
examples/history-api-fallback Expand file tree Collapse file tree 2 files changed +33
-7
lines changed Original file line number Diff line number Diff line change @@ -21,13 +21,41 @@ Usage via CLI:
2121npx webpack serve --open --history-api-fallback
2222```
2323
24- _ Note: some URLs don't work by default. For example; if the url contains a dot.
24+ ## What Should Happen
25+
26+ 1 . The script should open ` http://0.0.0.0:8080/ ` in your default browser.
27+ 2 . You should see text on the page that reads ` Current Path: / ` .
28+ 3 . Navigate to ` http://localhost:8080/foo-bar ` .
29+ 4 . You should see text on the page that reads ` Current Path: /foo-bar ` .
30+
31+ _ Note: some URLs don't work by default. For example, if the url contains a dot (` /file.txt ` in this example).
2532Be sure to checkout the [ connect-history-api-fallback] ( https://github.com/bripkens/connect-history-api-fallback )
2633options._
2734
35+ To allow ` /file.txt ` to fallback, update the ` webpack.config.js ` as follows:
36+
37+ ** webpack.config.js**
38+
39+ ``` js
40+ module .exports = {
41+ // ...
42+ devServer: {
43+ historyApiFallback: {
44+ disableDotRule: true ,
45+ },
46+ },
47+ };
48+ ```
49+
50+ Usage via CLI:
51+
52+ ``` console
53+ npx webpack serve --open
54+ ```
55+
2856## What Should Happen
2957
30581 . The script should open ` http://0.0.0.0:8080/ ` in your default browser.
31- 2 . You should see text on the page that reads ' Current Path: /' .
32- 3 . Navigate to ` http://localhost:8080/foo/bar ` .
33- 4 . You should see text on the page that reads ' Current Path: /foo/background' .
59+ 2 . You should see text on the page that reads ` Current Path: / ` .
60+ 3 . Navigate to ` http://localhost:8080/file.txt ` .
61+ 4 . You should see text on the page that reads ` Current Path: /file.txt ` .
Original file line number Diff line number Diff line change @@ -8,8 +8,6 @@ module.exports = setup({
88 context : __dirname ,
99 entry : "./app.js" ,
1010 devServer : {
11- historyApiFallback : {
12- disableDotRule : true ,
13- } ,
11+ historyApiFallback : true ,
1412 } ,
1513} ) ;
You can’t perform that action at this time.
0 commit comments