- SocketStream
- ExpressJS
- AngularJS
- Twitter Bootstrap
- Jade Templates
- MochaJS testing
- SinonJS testing
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
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).
Handled by route.js and AppCtrl and the AngularJS ng-switch directive.
Example Routes
There is a controller for each route.
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
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) { });
- @polidore - the angular services in here that wrap socket stream
rpc
andpubsub
were derived / borrowed from the ss-angular project - Pierre-Yves GĂ©rardy for his great ideas on setting up client side unit testing with SocketStream + AngularJS