undefined - "ReferenceError: handler is not defined" in Node.js -


this first line of node.js app:

var app     = require('http').createserver(handler); 

when try start doing node index.js result is:

/home/username/public_html/index.js:1 var app     = require('http').createserver(handler);                                            ^ referenceerror: handler not defined 

my node.js version 0.12.4

you that's first line of code. problem not define handler variable. should function responds request event. since optional, can (if wish) leave out entirely , add handlers events later on.

var app     = require('http').createserver(); 

Comments

Popular posts from this blog

html - height not adding height to a empty div -

Oracle SQL. How to select specific IDs where value of columns specify criteria? -

python - Robot Framework location and name of keyword -