Created
July 21, 2010 16:49
-
-
Save AlyxRen/484746 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fab = require('./'); | |
for (var i in fab){ | |
global[i] = fab[i]; | |
} | |
require('http').createServer( | |
( fab ) | |
( nodejs ) | |
( contentLength ) | |
( stringify ) | |
( /\/date/ ) | |
( tmpl ) | |
( "The Date is <%= this.toDateString() %>." ) | |
() | |
( /\/time/ ) | |
( tmpl ) | |
( "The Time is <%= this.toTimeString() %>." ) | |
() | |
( new Date ) | |
).listen( 4000 ); | |
//error is received when you try to go to /date or /time | |
/*! Error Message: | |
/home/rixius/node/fab/apps/fab.tmpl.js:28 | |
obj.body = fn.call( obj.body ); | |
^ | |
TypeError: Object [object Object] has no method 'call' | |
at Object.<anonymous> (/home/rixius/node/fab/apps/fab.tmpl.js:28:21) | |
at listener (/home/rixius/node/fab/apps/fab.map.js:10:40) | |
at Function.<anonymous> (/home/rixius/node/fab/apps/fab.body.js:8:15) | |
at /home/rixius/node/fab/apps/fab.path.js:41:21 | |
at /home/rixius/node/fab/apps/fab.path.js:42:28 | |
at Server.<anonymous> (/home/rixius/node/fab/apps/fab.nodejs.js:18:17) | |
at Server.emit (events:33:26) | |
at HTTPParser.onIncoming (http:825:10) | |
at HTTPParser.onHeadersComplete (http:87:31) | |
at Stream.ondata (http:757:22) | |
*/ |
Thanks, I don't know why i didn't try that...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the problem seems to be with your use of
global
, since the following works: