title: Node.js browser error Cannot GET/
body: <p>I'm quite new to Node, I've been following a tutorial to build a simple server that serves dynamic pags with some basic routes but keep getting the <code>Error: Cannot GET/</code> after running <code>node server.js</code> and calling localhost:3300 on the browser. My routes are defined externally and initialized using a <code>routes.initialise()</code> as follows:</p>
  
  <pre><code>//routes.js
  var home = require('../controllers/home'),
  image = require('../controllers/image'),
  express = require('express');
  
  module.exports.initialize = function(app, router) {
  //var router = express.Router();
  
  router.get('/', home.index);
  router.get('/images/:image_id', image.index);
  router.post('/images', image.create);
  router.post('/images/:image_id/like', image.like);
  router.post('/images/:image_id/comment', image.comment);
  
  app.use('/', router);
  };
  </code></pre>
  
  <p>I've searched far and wide but no solution forthcoming. I'm really frustrated and will need some help here.</p>
  
  <p>I have a server.js that creates the server:</p>
  
  <pre><code>//server.js
  var express = require('express'), 
  config = require('./server/configure'),    
  app = express(); 
  
  app.set('port', process.env.PORT || 3300); 
  app.set('views', __dirname + '/views');
  app = config(app);
  
  
  var server = app.listen(app.get('port'), function() {    
  console.log('Server up: http://localhost:' + app.get('port')); 
  });
  </code></pre>
  
  <p>and a configure.js that configures the server:</p>
  
  <pre><code>//configure.js
  var path = require('path'),
  routes = require('./routes'),
  exphbs = require('express3-handlebars'),
  express = require('express'),
  bodyParser = require('body-parser'),
  cookieParser = require('cookie-parser'),
  morgan = require('morgan'),
  methodOverride = require('method-override'),
  errorHandler = require('errorhandler');
  
  module.exports = function(app) {
  app.engine('handlebars', exphbs.create({
      defaultLayout: 'main',
      layoutsDir: app.get('views') + '/layouts',
      partialsDir: [app.get('views') + '/partials']
  }).engine);
  
  app.set('view engine', 'handlebars');
  app.use(morgan('dev'));
  app.use(bodyParser({
      uploadDir:path.join(__dirname, 'public/upload/temp')
  }));
  
  app.use(methodOverride());
  app.use(cookieParser('some-secret-value-here'));
  routes.initialize(app, new express.Router());
  
  app.use('/public/', express.static(path.join(__dirname, '../public')));
  
  if ('development' === app.get('env')) {
      app.use(errorHandler());
  }
  
  return app;
  };
  </code></pre>
  
  <p>also two files, <code>home.js</code> and <code>image.js</code> which are supposed to provide the default routes from configure.js:</p>
  
  <pre><code>//home.js
  module.exports = {
  index: function(req, res) {
      res.send('The home:index controller');
  }
  };
  
  //image.js
  module.exports = {    
  index: function(req, res) {        
      res.send('The image:index controller ' + req.params.image_id);    
  },
  
  create: function(req, res) {        
      res.send('The image:create POST controller');    
  },    
  
  like: function(req, res) {        
      res.send('The image:like POST controller');    
  },    
  
  comment: function(req, res) {        
      res.send('The image:comment POST controller');    
  } 
  };
  </code></pre>
  
  <p>Anytime I try to GET any of the links on the browser it returns the Cannot GET/ error. Any help will be greatly appreciated.</p>
  
  <p>Thank you so much :)</p>