I am using Expressjs and nodejs for accessing file and through that I am sending response to Angularjs. I am using json
data to display the content in by browser. when I run the server, port is not displaying any message.
ExpressJS:
var express = require('express');
var config = require('./config');
var jsonserver = require('json-server');
var app = express();
app.use(express.static(__dirname + '/public'));
app.get('/contact', function(req,res) {
if (res.sendFile(path.normalize(__dirname + '/public/contact.json'))) {
console.log('Request is received');
} else {
console.log('Error');
}
});
I don't where I Have gone wrong. Please let me know my mistake . Any help/advise greatly appreciated.