Express JS express.static not working

I was going through the express.static middleware in the curriculum, but it doesn’t seem to work even though my code is correct


let express = require('express');
let app = express();
const path = require('path')

app.use('/public', express.static(path.join(__dirname, 'public')))

 module.exports = app;

Can somebody help?

I did this in the local environment, it didn’t work, but it is working on repl it? :thinking: