bripkens / connect-history-api-fallback

Fallback to index.html for applications that are using the HTML 5 history API
MIT License
1.82k stars 141 forks source link

static/js notfound #48

Open guoxiangwen opened 6 years ago

guoxiangwen commented 6 years ago

app.use(express.static(path.resolve(dirname, config.outputDir))); app.use(express.static(path.resolve(dirname, './../files'))); app.use(history({

}));

app.use(express.static(path.resolve(dirname, config.outputDir))); app.use(express.static(path.resolve(dirname, './../files')));

when i set this. it found static/js/xxx.js not found image

trollepierre commented 5 years ago

This line app.use(history());

should come before this line app.use(express.static(path.join(__dirname, '..', 'client', 'dist')));