title: Failed to lookup view with Express + jade + angular
body: <p>Like so many before me I am getting the following error:</p>
  
  <pre><code>Failed to lookup view "/partials/test" in views directory    "/home/aveline/git/multivision/server/views"
  </code></pre>
  
  <p>Since I am using Jade, my templates get rendered through app.get (this is my server.js file):</p>
  
  <pre><code>var express = require('express'), 
  stylus = require('stylus'),
  logger = require('morgan'),
  bodyParser = require('body-parser');
  
  var env = process.env.NODE_ENV = process.env.NODE_ENV || 'development';
  
  var app = express();
  
  function compile(str, path){
     return stylus(str).set('filename', path);
  }
  
  app.set('views', __dirname + '/server/views');
  app.set('view engine','jade');
  app.use(logger('dev'));
  app.use(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);
  });
  app.get('*', function(req, res){
      res.render('index');
  });
  
  var port = 3030;
  app.listen(port);
  console.log("Listening on port " + port);
  </code></pre>
  
  <p>The thing is, this template "test.jade" is actually here in that directory. So when I go to localhost:3030 (the port I listen to), i get this error (full-stack):</p>
  
  <pre><code>Error: Failed to lookup view "/partials/test" in views directory "/home/aveline/git/multivision/server/views"
  at Function.app.render (/home/aveline/git/multivision/node_modules/express/lib/application.js:485:17)
  at ServerResponse.res.render (/home/aveline/git/multivision/node_modules/express/lib/response.js:794:7)
  at Object.port [as handle] (/home/aveline/git/multivision/server.js:27:6)
  at next_layer (/home/aveline/git/multivision/node_modules/express/lib/router/route.js:113:13)
  at Route.dispatch (/home/aveline/git/multivision/node_modules/express/lib/router/route.js:117:5)
  at /home/aveline/git/multivision/node_modules/express/lib/router/index.js:222:24
  at param (/home/aveline/git/multivision/node_modules/express/lib/router/index.js:307:14)
  at param (/home/aveline/git/multivision/node_modules/express/lib/router/index.js:323:14)
  at Function.proto.process_params (/home/aveline/git/multivision/node_modules/express/lib/router/index.js:367:3)
  at next (/home/aveline/git/multivision/node_modules/express/lib/router/index.js:216:19)
  </code></pre>
  
  <p>Could anyone help me with this? I have tried several other solutions on other threads but none worked so far.</p>
  
  <p>If you need more code samples, please say so in the comments.</p>
  
  <p>EDIT: I found the solution, look at my answer below.</p>