Skip to content

Commit dc014c8

Browse files
Radu Serbanescuchimurai
authored andcommitted
Update lite-server example (#168)
Prevent overwrite of default middleware.
1 parent 940b591 commit dc014c8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

recipes/servers.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ http.createServer(app).listen(3000);
8686
## lite-server
8787

8888
https://github.com/johnpapa/lite-server
89-
[![GitHub stars](https://img.shields.io/github/stars/johnpapa/lite-server.svg?style=social&label=Star)](https://github.com/johnpapa/lite-server) ([example source](https://github.com/johnpapa/lite-server/issues/61#issuecomment-205997607))
89+
[![GitHub stars](https://img.shields.io/github/stars/johnpapa/lite-server.svg?style=social&label=Star)](https://github.com/johnpapa/lite-server)
9090

9191
File: `bs-config.js`
9292

@@ -100,8 +100,11 @@ var apiProxy = proxy('/api', {
100100

101101
module.exports = {
102102
server: {
103+
// Start from key `10` in order to NOT overwrite the default 2 middleware provided
104+
// by `lite-server` or any future ones that might be added.
105+
// Reference: https://github.com/johnpapa/lite-server/blob/master/lib/config-defaults.js#L16
103106
middleware: {
104-
1: apiProxy
107+
10: apiProxy
105108
}
106109
}
107110
};

0 commit comments

Comments
 (0)