9. Object handle
/home/harish/Apps-dev/api libs/express-mvc/routes/index.js 7
8. next_layer <#anonymous>
/home/harish/Apps-dev/api libs/express-mvc/node_modules/express/lib/router/route.js 103
7. Route dispatch
/home/harish/Apps-dev/api libs/express-mvc/node_modules/express/lib/router/route.js 107
6. <#anonymous>
/home/harish/Apps-dev/api libs/express-mvc/node_modules/express/lib/router/index.js 205
5. Function proto.process_params
/home/harish/Apps-dev/api libs/express-mvc/node_modules/express/lib/router/index.js 268
4. next <#anonymous>
/home/harish/Apps-dev/api libs/express-mvc/node_modules/express/lib/router/index.js 199
3. Function proto.handle
/home/harish/Apps-dev/api libs/express-mvc/node_modules/express/lib/router/index.js 151
2. Layer router
/home/harish/Apps-dev/api libs/express-mvc/node_modules/express/lib/router/index.js 24
1. trim_prefix <#anonymous>
/home/harish/Apps-dev/api libs/express-mvc/node_modules/express/lib/router/index.js 239
0. <#anonymous>
/home/harish/Apps-dev/api libs/express-mvc/node_modules/express/lib/router/index.js 207

ReferenceError (500) ReferenceError: i is not defined<br> &nbsp; &nbsp;at Object.handle (/home/harish/Apps-dev/api libs/express-mvc/routes/index.js:7:17)<br> &nbsp; &nbsp;at next_layer (/home/harish/Apps-dev/api libs/express-mvc/node_modules/express/lib/router/route.js:103:13)<br> &nbsp; &nbsp;at Route.dispatch (/home/harish/Apps-dev/api libs/express-mvc/node_modules/express/lib/router/route.js:107:5)<br> &nbsp; &nbsp;at /home/harish/Apps-dev/api libs/express-mvc/node_modules/express/lib/router/index.js:205:24<br> &nbsp; &nbsp;at Function.proto.process_params (/home/harish/Apps-dev/api libs/express-mvc/node_modules/express/lib/router/index.js:268:12)<br> &nbsp; &nbsp;at next (/home/harish/Apps-dev/api libs/express-mvc/node_modules/express/lib/router/index.js:199:19)<br> &nbsp; &nbsp;at Function.proto.handle (/home/harish/Apps-dev/api libs/express-mvc/node_modules/express/lib/router/index.js:151:3)<br> &nbsp; &nbsp;at Layer.router (/home/harish/Apps-dev/api libs/express-mvc/node_modules/express/lib/router/index.js:24:12)<br> &nbsp; &nbsp;at trim_prefix (/home/harish/Apps-dev/api libs/express-mvc/node_modules/express/lib/router/index.js:239:15)<br> &nbsp; &nbsp;at /home/harish/Apps-dev/api libs/express-mvc/node_modules/express/lib/router/index.js:207:9

i is not defined

  1. var express = require('express');
  2. var router = express.Router();
  3. /* GET home page. */
  4. router.get('/', function(req, res) {
  5. console.log(i);
  6. res.writeHead(200, {'Content-Type': 'text/plain'});
  7. res.end('Hello World \n');
  8. });
  1. }
  2. if (arity > 3) {
  3. return next_layer();
  4. }
  5. try {
  6. layer.handle(req, res, next_layer);
  7. } catch (err) {
  8. next_layer(err);
  1. }
  2. try {
  3. layer.handle(req, res, next_layer);
  4. } catch (err) {
  5. next_layer(err);
  6. }
  7. })();
  8. };
  1. // this should be done for the layer
  2. return self.process_params(layer, req, res, function(err) {
  3. if (err) {
  4. return next(err);
  5. }
  6. if (route) {
  7. return layer.handle(req, res, next);
  8. }
  9. trim_prefix();
  1. var params = this.params;
  2. // captured parameters from the route, keys and values
  3. var keys = route.keys;
  4. // fast track
  5. if (!keys || keys.length === 0) {
  6. return done();
  7. }
  1. options.push.apply(options, route._options());
  2. }
  3. }
  4. req.params = layer.params;
  5. // this should be done for the layer
  6. return self.process_params(layer, req, res, function(err) {
  7. if (err) {
  8. return next(err);
  1. if (err || options.length === 0) return old(err);
  2. var body = options.join(',');
  3. return res.set('Allow', body).send(body);
  4. });
  5. }
  6. next();
  7. function next(err) {
  1. * @api public
  2. */
  3. var proto = module.exports = function(options) {
  4. options = options || {};
  5. function router(req, res, next) {
  6. router.handle(req, res, next);
  7. }
  1. if (err) {
  2. if (arity === 4) {
  3. layer.handle(err, req, res, next);
  4. } else {
  5. next(err);
  6. }
  7. } else if (arity < 4) {
  8. layer.handle(req, res, next);
  9. } else {
  10. next(err);
  1. if (err) {
  2. return next(err);
  3. }
  4. if (route) {
  5. return layer.handle(req, res, next);
  6. }
  7. trim_prefix();
  8. });
Key Value
REMOTE_ADDR ::ffff:127.0.0.1
REMOTE_PORT 45007
SERVER_SOFTWARE NodeJS 0.12.0 Linux
SERVER_PROTOCOL HTTP/1.1
REQUEST_URI /
REQUEST_METHOD GET
SCRIPT_FILE /home/harish/Apps-dev/api libs/express-mvc/bin/www
PATH_INFO /
QUERY_STRING null
HTTP_HOST localhost:3001
HTTP_CONNECTION keep-alive
HTTP_CACHE_CONTROL max-age=0
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_USER_AGENT Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36
HTTP_DNT 1
HTTP_ACCEPT_ENCODING gzip, deflate, sdch
HTTP_ACCEPT_LANGUAGE en-US,en;q=0.8
HTTP_COOKIE
Key Value
queryStringData {}
requestBody {}
empty
Key Value
XDG_VTNR 7
MANPATH /home/harish/.nvm/versions/node/v0.12.0/share/man:/usr/local/man:/usr/local/share/man:/usr/share/man:/usr/lib/jvm/java-8-oracle/man:/home/harish/.rvm/man
NVM_IOJS_ORG_VERSION_LISTING https://iojs.org/dist/index.tab
SSH_AGENT_PID 2193
XDG_SESSION_ID c3
rvm_bin_path /home/harish/.rvm/bin
XDG_GREETER_DATA_DIR /var/lib/lightdm-data/harish
SELINUX_INIT YES
CLUTTER_IM_MODULE xim
COMP_WORDBREAKS "'><;|&(:
GEM_HOME /home/harish/.rvm/gems/ruby-2.1.3
GPG_AGENT_INFO /run/user/1000/keyring-tAnpEk/gpg:0:1
TERM xterm
VTE_VERSION 3409
SHELL /bin/bash
SSH_AGENT_LAUNCHER upstart
IRBRC /home/harish/.rvm/rubies/ruby-2.1.3/.irbrc
DERBY_HOME /usr/lib/jvm/java-8-oracle/db
NVM_PATH /home/harish/.nvm/versions/node/v0.12.0/lib/node
WINDOWID 67108876
OLDPWD /home/harish/Apps-dev/api libs/express-mvc
UPSTART_SESSION unix:abstract=/com/ubuntu/upstart-session/1000/2128
GNOME_KEYRING_CONTROL /run/user/1000/keyring-tAnpEk
MY_RUBY_HOME /home/harish/.rvm/rubies/ruby-2.1.3
GTK_MODULES overlay-scrollbar:unity-gtk-module
NVM_DIR /home/harish/.nvm
USER harish
LS_COLORS rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
_system_type Linux
XDG_SESSION_PATH /org/freedesktop/DisplayManager/Session0
rvm_path /home/harish/.rvm
XDG_SEAT_PATH /org/freedesktop/DisplayManager/Seat0
SSH_AUTH_SOCK /run/user/1000/keyring-tAnpEk/ssh
DEFAULTS_PATH /usr/share/gconf/ubuntu.default.path
SENCHA_CMD_3_0_0 /home/harish/bin/Sencha/Cmd/5.1.2.52
XDG_CONFIG_DIRS /etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg
rvm_prefix /home/harish
DESKTOP_SESSION ubuntu
PATH /home/harish/bin/Sencha/Cmd/5.1.2.52:/home/harish/bin/Sencha/Cmd/5.0.0.160:/home/harish/.rvm/gems/ruby-2.1.3/bin:/home/harish/.rvm/gems/ruby-2.1.3@global/bin:/home/harish/.rvm/rubies/ruby-2.1.3/bin:/opt/SenchaSDKTools-2.0.0-beta3:/home/harish/bin/Sencha/Cmd/5.1.2.52:/opt/SenchaSDKTools-2.0.0-beta3:/home/harish/bin/Sencha/Cmd/5.0.0.160:/home/harish/bin:/home/harish/bin/Sencha/Cmd/5.1.2.52:/usr/local/heroku/bin:/home/harish/.nvm/versions/node/v0.12.0/bin:/opt/SenchaSDKTools-2.0.0-beta3:/home/harish/bin/Sencha/Cmd/5.0.0.160:/home/harish/bin/Sencha/Cmd/5.1.2.52:/opt/SenchaSDKTools-2.0.0-beta3:/home/harish/bin/Sencha/Cmd/5.0.0.160:/home/harish/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/home/harish/.rvm/bin:/home/harish/.rvm/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin:/home/harish/.rvm/bin:/home/harish/.rvm/bin:/home/harish/.rvm/bin:/home/harish/.rvm/bin
QT_IM_MODULE ibus
QT_QPA_PLATFORMTHEME appmenu-qt5
NVM_NODEJS_ORG_MIRROR https://nodejs.org/dist
PWD /home/harish/Apps-dev/api libs/express-mvc/bin
JOB gnome-session
XMODIFIERS @im=ibus
JAVA_HOME /usr/lib/jvm/java-8-oracle
GNOME_KEYRING_PID 2126
LANG en_IN
GDM_LANG en_US
MANDATORY_PATH /usr/share/gconf/ubuntu.mandatory.path
NODE_PATH /usr/local/lib/node_modules
SENCHA_SDK_TOOLS_2_0_0_BETA3 /opt/SenchaSDKTools-2.0.0-beta3
_system_arch i386
UBUNTU_MENUPROXY 1
COMPIZ_CONFIG_PROFILE ubuntu
IM_CONFIG_PHASE 1
_system_version 14.04
GDMSESSION ubuntu
rvm_version 1.25.32 (stable)
SESSIONTYPE gnome-session
SHLVL 1
HOME /home/harish
XDG_SEAT seat0
LANGUAGE en_IN:en
GNOME_DESKTOP_SESSION_ID this-is-deprecated
UPSTART_INSTANCE
UPSTART_EVENTS started starting
LOGNAME harish
GEM_PATH /home/harish/.rvm/gems/ruby-2.1.3:/home/harish/.rvm/gems/ruby-2.1.3@global
DBUS_SESSION_BUS_ADDRESS unix:abstract=/tmp/dbus-US7gGckrNH
J2SDKDIR /usr/lib/jvm/java-8-oracle
XDG_DATA_DIRS /usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/
QT4_IM_MODULE xim
NVM_BIN /home/harish/.nvm/versions/node/v0.12.0/bin
LESSOPEN | /usr/bin/lesspipe %s
NVM_IOJS_ORG_MIRROR https://iojs.org/dist
INSTANCE Unity
TEXTDOMAIN im-config
UPSTART_JOB unity-settings-daemon
XDG_RUNTIME_DIR /run/user/1000
DISPLAY :0
XDG_CURRENT_DESKTOP Unity
GTK_IM_MODULE ibus
J2REDIR /usr/lib/jvm/java-8-oracle/jre
RUBY_VERSION ruby-2.1.3
LESSCLOSE /usr/bin/lesspipe %s %s
_system_name Ubuntu
TEXTDOMAINDIR /usr/share/locale/
XAUTHORITY /home/harish/.Xauthority
COLORTERM gnome-terminal
_ ./www
DEBUG express-mvc
0. PrettyPageHandler