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

##Code

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

app.get('/',(req,res)=>{
  res.sendFile("/views/index.html",{root:__dirname})
  console.log("loool")
})
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: