Permalink
Browse files

cleaned up pathing

  • Loading branch information...
chrismatthieu committed Feb 13, 2011
1 parent 729c1c1 commit cad9a914c424656959a9924b7cfcaab5a96340e2
Showing with 20 additions and 16 deletions.
  1. +1 −1 app.js
  2. +1 −0 deps/nodemon
  3. +14 −10 lib/lib.js
  4. +2 −3 lib/middle.js
  5. +1 −1 public/api.html
  6. +1 −1 public/index.html
View
2 app.js
@@ -10,7 +10,7 @@ http://nodester.com
var express = require('express'),
url = require('url'),
sys = require('sys'),
- config = require("./config"),
+ config = require('./config'),
middle = require('./lib/middle');
process.on('uncaughtException', function (err) {
Submodule nodemon added at 173832
View
@@ -35,7 +35,7 @@ var get_couchdb_connection = function () {
return new cradle.Connection({
host: config.opt.couch_host,
port: config.opt.couch_port,
- auth: {user: config.opt.couch_user, pass: config.opt.couch_pass},
+ auth: {username: config.opt.couch_user, password: config.opt.couch_pass},
options: {cache: false, raw: false}
});
};
@@ -63,15 +63,19 @@ var build_proxytable_map = function (cb) {
var aliasdomains = conn.database(exports.couch_prefix + "aliasdomains");
var proxy_map = default_routes;
apps.view('nodeapps/all', function (err, resp) {
- resp.forEach(function (row) {
- proxy_map.router[row._id + "." + config.opt.tl_dom] = "127.0.0.1:" + row.port;
- });
- aliasdomains.view('aliasdomains/all', function (err, resp) {
- resp.forEach(function (row) {
- proxy_map.router[row._id] = row.host + ":" + row.port;
- });
- cb(proxy_map);
- });
+ if (err) {
+
+ } else {
+ resp.forEach(function (row) {
+ proxy_map.router[row._id + "." + config.opt.tl_dom] = "127.0.0.1:" + row.port;
+ });
+ aliasdomains.view('aliasdomains/all', function (err, resp) {
+ resp.forEach(function (row) {
+ proxy_map.router[row._id] = row.host + ":" + row.port;
+ });
+ cb(proxy_map);
+ });
+ }
});
};
exports.build_proxytable_map = build_proxytable_map;
View
@@ -1,7 +1,6 @@
var lib = require('./lib'),
cradle = require('cradle'),
- config = require('./config');
-
+ config = require('../config');
/**
* Dynamic express route to authenticate a user from CouchDB
@@ -11,7 +10,7 @@ var authenticate = function(req, res, next) {
if (typeof basicauth != 'undefined' && basicauth.length > 0) {
var buff = new Buffer(basicauth.substring(basicauth.indexOf(" ") + 1 ), encoding='base64');
- var creds = buff.toString('ascii')
+ var creds = buff.toString('ascii');
var username = creds.substring(0,creds.indexOf(":"));
var password = creds.substring(creds.indexOf(":") + 1);
View
@@ -36,7 +36,7 @@
<h3>Did you get your coupon code? <a href="#" onclick="tb_remove()">I wish!</a></p></h3>
<fieldset>
- <form action="http://nodester.com/user" method="post">
+ <form action="/user" method="post">
<p><label for="name">Coupon:</label>
<input type="password" name="coupon" id="coupon" value="" /><br />
<label for="name">Username:</label>
View
@@ -38,7 +38,7 @@
<h3>Did you get your coupon code? <a href="#" onclick="tb_remove()">I wish!</a></p></h3>
<fieldset>
- <form action="http://www.nodester.com/user" method="post">
+ <form action="/user" method="post">
<p><label for="name">Coupon:</label>
<input type="password" name="coupon" id="coupon" value="" /><br />
<label for="name">Username:</label>

0 comments on commit cad9a91

Please sign in to comment.