Home > other >  Express static work only with filename index.html
Express static work only with filename index.html

Time:10-20

So i have a problem with my static files. Here's my code:

const express = require ('express')

const app = express()

app.listen(4040,() => console.log("on"))
app.use(express.static(__dirname   "/public"))

Everything works. Until I change html file name in public folder It works if it's index.html but doesn't if it's about.html or everything else.

My folders are like that:

           
  • Related