Browse files

adopted meryl to work in conjuction with latest connect version of 2.4.2

  • Loading branch information...
1 parent 8c31a9c commit b767a6efce71293672ef5d748812b8691f1982cf @kadirpekel committed Jul 25, 2012
View
1 .gitignore
@@ -1 +1,2 @@
*.sw?
+node_modules
View
2 examples/coffeekup-template/app.coffee
@@ -6,7 +6,7 @@ people = ['animal', 'beakers', 'piggy', 'kermit']
(require '../../index')
.plug connect.logger(),
- connect.static(".")
+ connect.static(__dirname)
.get '/', (req, resp) ->
resp.redirect('/people')
View
8 examples/connect/app.js
@@ -1,4 +1,4 @@
-var Connect = require('connect'),
+var connect = require('connect'),
meryl = require('../../index');
meryl
@@ -7,11 +7,11 @@ meryl
resp.setHeader('backend', 'nodejs/connect/meryl');
next();
},
- Connect.logger()
+ connect.logger()
)
.p('GET *',
- Connect.favicon(),
- Connect.static(".")
+ connect.favicon(),
+ connect.static(__dirname)
)
.h('GET /', function (req, resp) {
resp.end("<h1>Welcome To NodeJS!</h1><img src='nodejs.png' />");
View
2 examples/fabby/app.js
@@ -2,7 +2,7 @@ with (require('connect')) {
require('../../index') // meryl
.fabby
- (logger(), static("."))
+ (logger(), static(__dirname))
('GET /', function (req, resp) {
resp.render('home');
}
View
2 examples/standalone/boot.js
@@ -7,5 +7,5 @@ module.exports = function (meryl) {
meryl.options.templateExt = '.mt', // Default is '.jshtml'
- meryl.plug(connect.static("."), connect.logger());
+ meryl.plug(connect.static(__dirname), connect.logger());
};
View
5 examples/twinkler/app.js
@@ -1,10 +1,11 @@
var meryl = require('../../index'),
- Connect = require('connect'),
+ connect = require('connect'),
qs = require('querystring');
var twinkles = ['This is my freaking first wink', 'Hey tweeting sucks, lets twinkle'];
-meryl.p(Connect.static('public'));
+meryl.p(connect.static(__dirname + '/public'));
+meryl.p(connect.bodyParser());
meryl.h('GET /', function (req, resp) {
resp.render('index', {twinkles: twinkles});
View
4 lib/meryl.js
@@ -7,7 +7,7 @@
/**
* Module dependencies
*/
-var sys = require('sys'),
+var util = require('util'),
http = require('http'),
url = require('url'),
fs = require('fs'),
@@ -420,7 +420,7 @@ http.ServerResponse.prototype.render = function (templateName, ctx) {
* current process. Exception stack trace is sent to stderr.
*/
process.on('uncaughtException', function (err) {
- sys.error(err instanceof Error ? err.stack : err);
+ util.error(err instanceof Error ? err.stack : err);
});
/*

0 comments on commit b767a6e

Please sign in to comment.