Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit b767a6efce71293672ef5d748812b8691f1982cf 1 parent 8c31a9c
kadirpekel authored
1  .gitignore
View
@@ -1 +1,2 @@
*.sw?
+node_modules
2  examples/coffeekup-template/app.coffee
View
@@ -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')
8 examples/connect/app.js
View
@@ -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' />");
2  examples/fabby/app.js
View
@@ -2,7 +2,7 @@ with (require('connect')) {
require('../../index') // meryl
.fabby
- (logger(), static("."))
+ (logger(), static(__dirname))
('GET /', function (req, resp) {
resp.render('home');
}
2  examples/standalone/boot.js
View
@@ -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());
};
5 examples/twinkler/app.js
View
@@ -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});
4 lib/meryl.js
View
@@ -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);
});
/*
Please sign in to comment.
Something went wrong with that request. Please try again.