Skip to content


Subversion checkout URL

You can clone with
Download ZIP
JavaScript CSS
Branch: master

Merge pull request #6 from pygy/patch-1

Small cleanup in demoRoute.js
latest commit 26f92e1a4d
@davisford davisford authored
Failed to load latest commit information.
client add missing client/templates/ dir to keep ss happy
server Small cleanup in demoRoute.js
test first commit
.gitignore first commit
.nodemonignore Initial commit
Makefile first commit Update
app.js fix typo
conf.js first commit
package.json first commit

This is a seed project for a web app that uses

I'm using it to seed new web apps, and as a playground for quickly trying new things.

$ npm install
$ node app.js

To run server side tests

$ make

To run client side tests

$ node app.js

...then open browser to http://localhost:3000/tests

Routing Examples

Demo app has some routes that are 100% client side, and some that are server-side...meaning client side routes are intercepted by Angular and handled in the browser, since this is a single page app. Conversely, server side routes are handled as new HTTP request to the browser which are processed by ExpressJS routing -- demonstration of how one can still provide a web service API on top of the SocketStream RPC/WebSocket application (e.g. for other clients or integration points).

Client Side Routing

Handled by route.js and AppCtrl and the AngularJS ng-switch directive.

Example Routes

  • http://localhost:3000/foo
  • http://localhost:3000/bar

There is a controller for each route.

Server Side Routing

Any JS files found under routes dir will be added to ExpressJS routing processor. There is a demoRoute.js which shows a standard web service request that returns some JSON

  • http://localhost:3000/demo

There's also an example of shared middleware -- a piece of middleware that can be injected into the path for both websockets and standard ExpressJS http routes.

That piece of middleware will run if a client hits http://localhost:3000/demo and it will also run if they call ss.rpc('demoRpc.get', function (err, resp) { });

Credit Due

Something went wrong with that request. Please try again.