app.get(‘/’,(req,res)=>
{
let absolutePath= __dirname + ‘/views/index.html’
res.sendFile(absolutePath)
})
app.use(express.static(__dirname + “/public”)) //not working
This is not responding the static files like css from public directory
app.get(‘/’,(req,res)=>
{
let absolutePath= __dirname + ‘/views/index.html’
res.sendFile(absolutePath)
})
app.use(express.static(__dirname + “/public”)) //not working
This is not responding the static files like css from public directory
Instead app.use(express.static(__dirname + “/public”)) try:
app.use(express.static("assets"))
It will serve all assets in /assets
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.