0

I am new to Node JS server config settings and while trying to set up my application on a Linux server, I am receiving the error:

Uncaught Syntax Error :Unexpected token <

If you see the image the !Doctype html is getting highlighted.

On checking my HTML I did not find any typo as well.

Error displayed as unexpected token and angular injector

The image 2 displays the  folder structure in the chrome source

The image 2 displays the folder structure in the chrome source where all my files have been loaded and the MultiDropDownCtrl.js file is displaying the HTML content instead of JavaScript source Code. My three controller files are throwing html index page, rest of my controllers are error free.

I would like to share the server.js config file for your reference. Please do let me know if I have missed any line or have set a wrong path.

//server.js file for node config 

var express = require('express');
var app = express();
app.use('/app',express.static(__dirname + '/app'));
app.use('/bower_components',express.static(__dirname +'/bower_components'));    
app.use('/node_modules',express.static(__dirname + '/node_modules'));  
app.all('/*', function(req, res) {
  res.sendFile('/', { root: __dirname });
});
app.listen(7000);
console.log('App started in port 7000');

Your help would be appreciated.

Heretic Monkey
  • 11,687
  • 7
  • 53
  • 122
csrikhi
  • 1
  • 4

0 Answers0