samedi 1 novembre 2014

Error: ENOENT, stat 'C:\main.html'


Vote count:

0




I am trying to run a sample angular app using the node js: Below is the code in the file server.js:



var express = require('express'),
app = express();
app
.use(express.static('./public'))
.get('*', function (req, res) {
res.sendFile('public/main.html');
})
.listen(3000);


But I am getting the below error: Error: ENOENT, stat 'C:\main.html'


My folder structure:



C:\Users\kk\Documents\angularWork\PracticeWork\contacts\public
C:\Users\kk\Documents\angularWork\PracticeWork\contacts\public\main.html


I am getting the following error:



Error: ENOENT, stat 'C:\main.html'


asked 1 min ago







Error: ENOENT, stat 'C:\main.html'

Aucun commentaire:

Enregistrer un commentaire