Permalink
Browse files

Replace express with connect and move connect outside startServer.

  • Loading branch information...
1 parent 04b7b56 commit e5cd3b31c7aca3de4219d0b4e408a4ce67fb0f70 @albertosantini committed Mar 3, 2012
Showing with 13 additions and 14 deletions.
  1. +3 −1 README.markdown
  2. +3 −2 examples/ex3.js
  3. +5 −9 lib/trammi.js
  4. +2 −2 package.json
View
@@ -115,13 +115,15 @@ It retrieves the arrivals of all the vehicles until a stop.
- *timetable* array containing the estimated time of arrivals in minutes.
-startServer(port, publicDir)
+startServer(connect, port, publicDir)
-----------
It starts a server providing a frontend for the module.
**Params**
+- *connect* connect object.
+
- *port* port of the server.
- *publicDir* directory of public folder containing the frontend.
View
@@ -1,9 +1,10 @@
/*jslint node:true, sloppy:true */
-var trammi = require('../lib/trammi'),
+var connect = require('connect'),
+ trammi = require('../lib/trammi'),
port = 8081;
-trammi.startServer(port);
+trammi.startServer(connect, port);
console.log("trammi started on port", port);
View
@@ -210,19 +210,15 @@ function getWaitingTime(lineName, stopNumber, cb) {
}
exports.getWaitingTime = getWaitingTime;
-function startServer(port, directory) {
- var express = require('express'),
- dnode = require('dnode'),
+function startServer(connect, port, directory) {
+ // var connect = require('connect'),
+ var dnode = require('dnode'),
p = port || 8081,
d = directory || __dirname + '/public',
server;
- console.log("Starting the server on", __dirname + "/public", "and", d);
-
- server = express.createServer();
-
- server.use(
- express.static(d)
+ server = connect(
+ connect.static(d)
);
dnode(function (client) {
View
@@ -1,7 +1,7 @@
{
"name" : "trammi",
"description" : "ETA app for public transport of Milan city",
- "version" : "0.4.7",
+ "version" : "0.4.8",
"main" : "index",
"repository" : "http://github.com/albertosantini/node-trammi",
"keywords": ["milan", "tram", "bus", "metro"],
@@ -18,7 +18,7 @@
"request": ">=2.9.152",
"jquery": ">=1.6.3",
"dnode": ">=0.9.6",
- "express": ">=2.5.8"
+ "connect": "=1.8.5"
}
}

0 comments on commit e5cd3b3

Please sign in to comment.