Skip to content

Commit 00c8502

Browse files
author
Marcin Szamotulski
committed
example server: respond with 404 for /favicon.ico
1 parent 23c2538 commit 00c8502

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

utils/serve-example.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@ app.use(express.static(path.resolve(__dirname, '..', 'dist')))
88

99
// handle every other route with index.html, which will contain
1010
// a script tag to your application's JavaScript file(s).
11-
app.get('*', function (request, response){
12-
response.sendFile(path.resolve(__dirname, '..', 'dist', 'index.html'))
11+
app.get('*', function (req, res){
12+
if (req.url == "/favicon.ico")
13+
res
14+
.status(404)
15+
.send("Not found")
16+
else
17+
res.sendFile(path.resolve(__dirname, '..', 'dist', 'index.html'))
1318
})
1419

1520
app.listen(port)

0 commit comments

Comments
 (0)