Permalink
Browse files

Fix docs and resolve public dir.

  • Loading branch information...
1 parent d1a2a61 commit 74178b093063f82ff6e843b0e7710095d13bc419 @albertosantini committed Mar 29, 2012
Showing with 24 additions and 6 deletions.
  1. +5 −0 HISTORY.markdown
  2. +15 −2 README.markdown
  3. +3 −3 lib/trammi.js
  4. +1 −1 package.json
View
@@ -1,3 +1,8 @@
+0.5.1 / 2012-03-29
+===================
+
+* Moved frontend folder coherent with joyent setup.
+
0.5.0 / 2012-03-28
===================
View
@@ -37,7 +37,7 @@ To install with [npm](http://github.com/isaacs/npm):
npm install trammi
-Tested with node 0.4.9 and 0.6.11.
+Tested with node 0.4.9 and 0.6.14.
Notes
=====
@@ -115,14 +115,27 @@ 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(port, publicDir, app, express)
-----------
It starts a server providing a frontend for the module.
+The method adds the following routes to the express instance:
+
+- /trammi/getStops
+
+- /trammi/getStopInfo
+
+- /trammi/getTimetable
+
**Params**
- *port* port of the server.
- *publicDir* directory of public folder containing the frontend.
+- *app* an instance of the express.HTTPServer, created with createServer().
+
+- *express* an instance of the express module.
+
+
View
@@ -210,12 +210,12 @@ function getWaitingTime(lineName, stopNumber, cb) {
}
exports.getWaitingTime = getWaitingTime;
-function startServer(port, directory) {
- var express = require('express'),
+function startServer(port, directory, app, express) {
+ var express = express || require('express'),
path = require('path'),
p = port || 8081,
d = path.resolve(__dirname, directory || __dirname + '/public'),
- app = express.createServer();
+ app = app || express.createServer();
app.configure(function () {
app.set("jsonp callback", true);
View
@@ -1,7 +1,7 @@
{
"name" : "trammi",
"description" : "ETA app for public transport of Milan city",
- "version" : "0.5.0",
+ "version" : "0.5.1",
"main" : "index",
"repository" : "http://github.com/albertosantini/node-trammi",
"keywords": ["milan", "tram", "bus", "metro"],

0 comments on commit 74178b0

Please sign in to comment.