you can just use extension option in express.static method .
app.use(express.static(path.join(__dirname, 'public'),{index:false,extensions:['html']}));
More Related Contents:
- How to get GET (query string) variables in Express.js on Node.js?
- req.body empty on posts
- bodyParser is deprecated express 4
- How to access the GET parameters after “?” in Express?
- Node.js – get raw request body using Express
- Express.js – app.listen vs server.listen
- Render a variable as HTML in EJS
- How to use a variable as a field name in mongodb-native findOne()?
- How to implement a secure REST API with node.js
- Express.js routing: optional splat param?
- Stream from a mongodb cursor to Express response in node.js
- How to protect the password field in Mongoose/MongoDB so it won’t return in a query when I populate collections?
- Mongoose .find() method causes requests to hang
- Node.js with Express: how to redirect a POST request
- Express JS use async function on requests
- HTML to PDF with Node.js
- Using PassportJS, how does one pass additional form fields to the local authentication strategy?
- Hooking up express.js with Angular CLI in dev environment
- How to specify HTTP error code using Express.js?
- Express routes parameter conditions
- res.redirect from POST
- Passing route control with optional parameter after root in express?
- Angularjs $http does not seem to understand “Set-Cookie” in the response
- How to organise file structure of backend and frontend in MERN
- Multiple View paths on Node.js + Express
- What is the proper way to check for existence of variable in an EJS template (using ExpressJS)?
- Express.js – any way to display a file/dir listing?
- Express.js Routing error: Can’t set headers after they are sent
- body-parser – extended option (qs vs querystring)
- How to limit upload file size in express.js