GET http://localhost:222/script.js net::ERR_ABORTED 404 (Not Found)
I am getting this error when rendering with script.js from index.html file with res.render. both files are in the same folder but script.js file cannot be found. in node js
const main = require("./routes/main");
app.use("/", main);
router.get('/', (req,res,next) => {
res.render('index.html')
})
This is how we used it.
THorse.Use(CORS);
Thorse.Use(Jhonson());
Is there a use like this?
app.use(express.static('public')) node.js
GET http://localhost:222/script.js net::ERR_ABORTED 404 (Not Found) I am getting this error when rendering with script.js from index.html file with res.render. both files are in the same folder but script.js file cannot be found. in node js
const main = require("./routes/main"); app.use("/", main); router.get('/', (req,res,next) => { res.render('index.html') }) This is how we used it.
THorse.Use(CORS); Thorse.Use(Jhonson()); Is there a use like this? app.use(express.static('public')) node.js