Skip to content
Browse files

fix stupid option names

  • Loading branch information...
1 parent c9c39cf commit c15405c2c74d994dd3528dab5e3a6cdaabd51ca6 @rsms committed Aug 3, 2010
Showing with 10 additions and 7 deletions.
  1. +1 −1 examples/example1/server.js
  2. +9 −6 oui/server/index.js
View
2 examples/example1/server.js
@@ -6,7 +6,7 @@ var fs = require('fs'),
var server = oui.server.start({
port: 8080,
documentRoot: path.dirname(fs.realpathSync(__filename)) + '/public',
- noSessionHandlers: true, // we don't use sessions or auth in this example
+ sessionHandlers: false, // we don't use sessions or auth in this example
});
// In this example we store our messages in memory. In a real world app you
View
15 oui/server/index.js
@@ -368,14 +368,17 @@ exports.processCommandLineOptions = function(options, args, onusage) {
exports.start = function(options) {
var opt = {
port: 80,
+ commandLineParsing: true,
+ standardHandlers: true,
+ sessionHandlers: true,
// addr, sock ..
// any other property is assigned to the server object
};
if (typeof options === 'object') {
mixin(opt, options);
}
// Unless command line parsing is disabled, parse options
- if (!opt.noCommandLineParsing) {
+ if (opt.commandLineParsing) {
oui.server.processCommandLineOptions(opt, null,
opt.onCommandLineParseError // optional callback(message, options)
);
@@ -387,19 +390,19 @@ exports.start = function(options) {
const skipopts = [
'port', 'addr',
'sock',
- 'noCommandLineParsing',
+ 'commandLineParsing',
'onCommandLineParseError',
- 'noStandardHandlers',
- 'noSessionHandlers',
+ 'standardHandlers',
+ 'sessionHandlers',
];
Object.keys(opt).forEach(function(k){
if (skipopts.indexOf(k) === -1) server[k] = opt[k];
});
// trim trailing slashes from pathPrefix
server.pathPrefix = server.pathPrefix.replace(/\/+$/, '');
// Unless noStandardHandlers...
- if (!opt.noStandardHandlers) {
- if (!opt.noSessionHandlers) {
+ if (opt.standardHandlers) {
+ if (opt.sessionHandlers) {
server.enableSessionHandlers(sessionPrefix);
}
server.enableBasicHandlers();

0 comments on commit c15405c

Please sign in to comment.
Something went wrong with that request. Please try again.