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
1// dependencies
2const path = require('path');
3
4// set static folder
5app.set(express.static(path.join(__dirname, 'public')));