A
A
akiam2016-01-13 21:24:02
Node.js
akiam, 2016-01-13 21:24:02

ExpressJS - base route and express.static not working?

I have in my application (on the Backbone client on the server - mongo node express) 2 lines

app.use(express.static(path.join(application_root, 'site')));

and
app.get('/',function(req,res){
console.log('Its a base url');
});

but the request for '/' does not work, I remove express.static - everything is fine. Is this because a single-static page is implied and therefore the '/' route is ignored?
and if I need to hide some blocks for the user "user", is it better to read about the template engine? Because, as far as I understand, session information needs to be transferred to the base route.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question