https://groups.google.com/a/cloudfoundry.org/group/vcap-dev/browse_thread/thread/2302e34dc37343d4
NATSのSPoFどうするよ??
exports.application = function(server){ | |
server.get('/', | |
newsFeeds, | |
misc.title('Home'), misc.renderWithBindings('index.ejs')); | |
server.get('/login', authorized, misc.redirect('/')); | |
server.get('/logout', oauth.logout, misc.redirect('/')); | |
server.get('/profiles/', authorized, misc.renderWithBindings('profiles/index.ejs')); | |
server.get('/archives/', authorized, misc.renderWithBindings('archives/index.ejs')); | |
server.get('/schedules/list', |
/*** | |
* @function make the parallel request filters and finish with the last filter. | |
* | |
* @example | |
* | |
* misc.parallel( | |
* func1, func2, func3, func4 | |
* ); | |
* | |
* func1 ---+ |
var rimraf = require('rimraf'), | |
path = require('path'), | |
fs = require('fs'); | |
// add-on modules | |
var cf_modules = ['iconv', 'jsdom']; | |
module.exports = function(cb){ | |
if( process.env.VCAP_APP_PORT ){ | |
// in cloud foundry |
var http = require('http'); | |
var tls = require('tls'); | |
var crypto = require('crypto'); | |
var opts = { | |
host: 'proxy.com', | |
port: 8080, | |
method: 'CONNECT', | |
path: 'securehost.com:443', | |
headers: { |
// insertの結果を待たずに実行 | |
col.insert({}, function(){}); // (a) | |
col.insert({}, function(){}); // (b) | |
// async.parallel を使って a, b は非同期で実行するが、 a, b, のりょうほうが終わったら c を呼ぶ | |
async.parallel({ | |
"a": function(cb){ | |
col.insert(..., cb); | |
}, | |
"b": function(cb){ |
> var server = new (require('mongodb').Server)('localhost', 27017); | |
> var db = new (require('mongodb').Db)('foo', server); | |
> db.open(function(){ | |
... db.collection('foo', function(_, collection){ | |
... collection.insert([{"_id": 'foo'}, {"_id": 'foo'}], {safe:true}, function(e){ console.log(e); }) | |
... }); | |
... }); | |
> { stack: [Getter/Setter], | |
arguments: undefined, | |
type: undefined, |
# install prerequisites | |
%w(libpcsclite-dev build-essential autoconf pcsc-tools pcscd).each do |p| | |
package p do | |
action :install | |
end | |
end | |
package "linux-headers-#{`uname -r`}" do | |
action :install | |
end |
{ | |
"http://api.cloud.yssk22.info":"xxxx", | |
"http://api.ec2.yssk22.info":"xxxx", | |
"http://api.aws-cf.yssk22.info":"xxxx", | |
"http://api.ec2-cf.yssk22.info":"xxxx", | |
"http://api.vcap.me":"xxxx", | |
"http://api.s3-support.yssk22.info":"xxxx", | |
"http://api.org-support.yssk22.info":"xxxx", | |
"http://api.flexible-routing.yssk22.info":"xxxx" | |
} |
# | |
# Author: Yohei Sasaki <[email protected]> | |
# | |
require 'resource_pool/resource_pool' | |
require 'aws/s3' | |
require 'tmpdir' | |
# | |
# A resource pool implementation to use S3. |