serve public folder express without file extension

Solutions on MaxInterview for serve public folder express without file extension by the best coders in the world

showing results for - "serve public folder express without file extension"
Joshua
20 Sep 2019
1// projectDirectory/src/index.js
2const path = require('path')
3const publicDirectoryPath = path.join(__dirname, '../public')
4app.use(express.static(publicDirectoryPath))
5
6// projectDirectory/public -> create index.html
7// localhost:3000/index.html -> Here you go..
8
9
Joseph
12 May 2018
1app.use(express.static(path.join(__dirname, 'public'),{index:false,extensions:['html']}));
2