Express.Static not working for subdirectory Express.Static not working for subdirectory express express

Express.Static not working for subdirectory


Use it this way:

app.use('/', express.static(__dirname + '/public'));app.use('/orgprofile', express.static(__dirname + '/public'));


Problem is not caused by express.static() expression. It might be due to wrong href value.express.static():

app.use(express.static(__dirname + "/public"));

Reference:

<link rel="stylesheet" type="text/css" href="/stylesheets/main.css">