Node JS res.sendFile() not working
问题 I'm getting ReferenceError: main is not defined when I open up the http://localhost:3000/ Here I try to open up the main.html located in views directory This is my app.js const express = require('express'), app = express(), config = require('./config/index'), routes = require('./routes/route'); app.use(express.static(`${__dirname}/public`)); app.use(express.static(`${__dirname}/views`)); app.use('/',routes); app.listen(config.port,()=>{ console.log(`Listing at port ${config.port}`)}) This is