express can't find static files in build folder. express can serve files in static folder now. but only problem that file path likes <link rel="icon" href="/favicon.ico"/> in index.html it reach res.send('ERROR')
however, when I change favicon and manifest path like <link rel="icon" href="/assets/favicon.ico"/>. it serve file I expected.
localhost//favicon.ico, can access favicon.ico in build folder. (not in assets). only double slash can access build folder, single slash cannot access that. Is my express startpoint localhost/ not localhost? server
|-server.js
|-build
|-static
|-assets
|-favicon.ico
|-manifest.json
|-index.html
|-favicon.ico
|-manifest.json
localhost => return index.html good
localhost/index.html, favicon.ico, else... => return ERROR
localhost/assets/favicon.ico, manifest.json => return files good
localhost//index.html, favicon.ico. else... => return files good
app.use('/static', express.static(path.join(__dirname, 'build/static')));
app.use(express.static(path.join(__dirname, 'build')));
app.use('/*', (req, res) => res.send('ERROR');