Name: apps-a-middleware
Owner: InterMine
Description: A Node.js reference implementation of a middleware for loading and rendering Apps
Created: 2013-06-24 11:16:09.0
Updated: 2014-01-16 11:19:27.0
Pushed: 2014-01-16 11:19:27.0
Homepage: http://apps-a-middleware.labs.intermine.org
Size: 1011
Language: CoffeeScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A Node.js reference implementation of a middleware for loading and rendering Apps.
m install
RT=1234 node example/index.js
And then visit 127.0.0.1:1234.
sr/bin/env coffee
= require 'http'
ect = require 'connect'
leware = require '../middleware.coffee'
= connect()
(middleware
'apps': [
'git://github.com/intermine/intermine-apps-a.git'
]
'config': __dirname + '/config.json'
(connect.static(__dirname + '/public'))
.createServer(app).listen process.env.PORT
The middleware accepts two params. One, apps
, is an Array of paths to app sources. This can be any of the following:
git://github.com/intermine/intermine-apps-a.git
file:///home/dev/intermine-apps-a
The other parameter, config
, represents the configuration you want merged with the config from the apps sources. This can be one of the following:
file:///home/dev/example-middleware/config.json
Only the first parameter is required.
Then, the middleware provides you with two routes:
/middleware/apps/a
- which gives you a config for all the apps it can serve/middleware/apps/a/:appId
- which returns one appBoth URLs are being used internally by the Apps client (see example/public/js/intermine.fatapps.js
).