0

I am trying to test my nodejs is install and configured correctly. I am running on a MAC.

I have followed the suggestion from here involving the server.

Below is the server I have setup. The file resides in the ~/ directory.

  1 var connect = require('connect'),
  2     serveStatic = require('serve-static');
  3 
  4     var app = connect();
  5 
  6     app.use(serveStatic("./node_modules/angular"));
  7     app.listen(5000);

Below is my test html file. It is located in the ~/node_modules/angular directory.

  1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2 <html>
  3 <head ng-app>
  4   <title>First Test</>
  5     <script src="angular.js"></script>
  6     <link href="bootstrap.css" rel="stylesheet" />
  7     <link href="bootstrap-theme.css" rel="stylesheet" />
  8 </head>
  9 <body>
 10 <div class=“btn btn-default”>{{“AngularJS”}}</div>
 11 <div class=“btn btn-success”>Bootstrap</div>
 12 </body>
 13 </html>

My problem is the server starts with no issues. The URL seems to be working. However, nothing is displaying in the browser. Where I go spying on the page. I see nothing.

Elements of the page

I am getting back a http response of 200 when I look at the network tab:

enter image description here

Any suggestions would be appreciated.

Community
  • 1
  • 1
rray
  • 470
  • 3
  • 10
  • 27
  • So what do you see in console when you run your server? – u_mulder Apr 19 '15 at 19:55
  • 1
    Do you have `“` instead of `"` in your code ? like - `“btn btn-default”>{{“AngularJS”}}` – swapnesh Apr 19 '15 at 19:57
  • You should also put ng-app on the body not the head. – Brad Barber Apr 19 '15 at 20:14
  • Nothing is showing up in the console. I am using vi to edit the files. I double checked the ["] to ensure all the ["] were the same. I change things where they did not look alike. In either case I am still seeing the same behavior. Also moved the **ng-app** to the body of the html file. – rray Apr 19 '15 at 20:17
  • You may be getting a cached version of the page - check the Network tab in the Dev Tools and make sure you're getting a 200 response and not a 304. – Brad Barber Apr 19 '15 at 20:44
  • Yep, page is getting a 200 response. – rray Apr 19 '15 at 21:05

1 Answers1

0

Finally! First of all thank you for your suggestions. Your comments and suggestions helped me work through my issue.

Here is what I changed:

  1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2 <html ng-app>
  3 <head lang="en">
  4   <meta charset="UTF-8">
  5   <title>First Test</title>
  6     <script src="angular.js" ></script>
  7     <link href="bootstrap.css" rel="stylesheet" />
  8     <link href="bootstrap-theme.css" rel="stylesheet" />
  9 </head>
 10 <body>
 11 <div class="btn btn-default">{{"AngularJS"}}</div>
 12 <div class="btn btn-success">Bootstrap</div>
 13 </body>
 14 </html>

Now I have the correct response:

enter image description here

rray
  • 470
  • 3
  • 10
  • 27