Skip to content

Instantly share code, notes, and snippets.

@thecopy
Last active August 29, 2015 13:56
Show Gist options
  • Save thecopy/9217334 to your computer and use it in GitHub Desktop.
Save thecopy/9217334 to your computer and use it in GitHub Desktop.
/**
* Module dependencies.
*/
var express = require('express');
var routes = require('./routes');
var user = require('./routes/user');
var http = require('http');
var path = require('path');
var app = express();
// all environments
app.set('port', process.env.PORT || 3000);
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.json());
app.use(express.urlencoded());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(path.join(__dirname, 'public')));
// development only
if ('development' == app.get('env')) {
app.use(express.errorHandler());
}
app.get('/', routes.index);
app.get('/users', user.list);
http.createServer(app).listen(app.get('port'), function(){
console.log('Express server listening on port ' + app.get('port'));
});
500 TypeError: /Users/thecopy/dev/node/alpwetter/views/index.jade:12<br/> 10| Bitte wählen Sie die Resorts Sie möchten die Wetter für sehen<br/> 11| ul<br/> > 12| each name in availableResorts<br/> 13| li<br/> 14| input(type='checkbox', value=name)<br/> 15| <br/><br/>Cannot read property 'length' of undefined
10| Bitte wählen Sie die Resorts Sie möchten die Wetter für sehen
11| ul
> 12| each name in availableResorts
13| li
14| input(type='checkbox', value=name)
15|
Cannot read property 'length' of undefined
at eval (eval at (/Users/thecopy/dev/node/alpwetter/node_modules/jade/lib/jade.js:160:8), :76:31)
at eval (eval at (/Users/thecopy/dev/node/alpwetter/node_modules/jade/lib/jade.js:160:8), :113:4)
at res (/Users/thecopy/dev/node/alpwetter/node_modules/jade/lib/jade.js:161:38)
at Object.exports.render (/Users/thecopy/dev/node/alpwetter/node_modules/jade/lib/jade.js:257:10)
at Object.exports.renderFile (/Users/thecopy/dev/node/alpwetter/node_modules/jade/lib/jade.js:293:18)
at View.exports.renderFile [as engine] (/Users/thecopy/dev/node/alpwetter/node_modules/jade/lib/jade.js:278:21)
at View.render (/Users/thecopy/dev/node/alpwetter/node_modules/express/lib/view.js:76:8)
at Function.app.render (/Users/thecopy/dev/node/alpwetter/node_modules/express/lib/application.js:504:10)
at ServerResponse.res.render (/Users/thecopy/dev/node/alpwetter/node_modules/express/lib/response.js:798:7)
at exports.index (/Users/thecopy/dev/node/alpwetter/routes/index.js:7:7)
extends layout
block content
h1= title
p Welcome to #{title}
div
h2 Hej
p.
Bitte wählen Sie die Resorts Sie möchten die Wetter für sehen
ul
each r in availableResorts
li
input(type='checkbox', value=r.name)
/*
* GET home page.
*/
exports.index = function(req, res){
res.render('index', {
title: 'Express',
availableResorts: [
{
name: 'Zermatt'
}
]
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment