0

I will start by saying that I am new to node.js and can not figure what I messed up. I am attempting to follow an tutorial to build a basic skeleton structure that I can use for over and over again. I believe my problem is comes from my use of the express.static not serving up my files correctly. Basically I have server.js file with the following code:

app.configure(function() {
    app.set('views', __dirname + '/server/views');
    app.set('view engine', 'jade');
    app.use(express.logger('dev'));
    app.use(express.bodyParser());
    app.use(stylus.middleware(
        {
            src: __dirname + '/public',
            compile: compile
        }
    ));
    app.use(express.static(__dirname + '/public'));
});

app.get('/partials/:partialPath', function(req, res) {
    res.render('partials/' + req.params.partialPath);
})

I also have another file named scripts.jade with the following code:

script(type="text/javascript", src="/vendor/jquery/jquery.js")
script(type="text/javascript", src="/vendor/angular/angular.js")
script(type="text/javascript", src="/vendor/angular-resource/angular-resourse.js")
script(type="text/javascript", src="/vendor/angular-route/angular-route.js")
script(type="text/javascript", src="/app/app.js")

When I navigate to the web site (http://localhost:3030/) I get the following text in my console and get a blank page in the browser:

enter image description here I have seen several post about the using express.static but I still can't figure out what I messed up. Any help would be greatly appreciated.

Why does it appear that the server can not find the files even though I have them in the locations in the file tree.

3
  • What do you see in your browser when you navigate to http://localhost:3030/? Commented Feb 9, 2014 at 16:20
  • You don't seemed to have actually described the problem you're having or asked a question. Commented Feb 9, 2014 at 16:29
  • I don't see anything in the browser when I load it. I will also update the question with a question. Commented Feb 9, 2014 at 18:06

1 Answer 1

1

Your express setup is fine, HTTP 304 means the browser requested content on server and node/express says is not modified:

http://www.checkupdown.com/status/E304.html

Sounds like your issue is with the client-side code.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.