Hi
I am new in meteor
I deployed my app on heroku using "heroku buildpacks:set https://github.com/AdmitHub/meteor-buildpack-horse.git"
but is showing “Procfile declares types -> (none)” .
So I added custom Procfile in root directory of app
Now app is not running on localhost:3000 and I get output
Uncaught TypeError: Cannot read property 'prototype' of undefined
at meteorInstall.node_modules.express.lib.request.js (modules.js?hash=520639d…:3239)
at fileEvaluate (modules-runtime.js?hash=637cb12…:191)
at require (modules-runtime.js?hash=637cb12…:116)
at meteorInstall.node_modules.express.lib.express.js (modules.js?hash=520639d…:752)
at fileEvaluate (modules-runtime.js?hash=637cb12…:191)
at require (modules-runtime.js?hash=637cb12…:116)
at meteorInstall.node_modules.express.index.js (modules.js?hash=520639d…:721)
at fileEvaluate (modules-runtime.js?hash=637cb12…:191)
at require (modules-runtime.js?hash=637cb12…:116)
at meteorInstall.proxy.js (proxy.js:6)
Procfile contain data
web: node proxy.js
and proxy.js contain
/*global process */
/**
* Module dependencies.
*/
var express = require('express'),
http = require('http'),
path = require('path'),
request = require('request');
var app = express();
app.use(function () {
console.log("process.env.Port", process.env.PORT)
app.set('port', process.env.PORT || 3000);
});
app.use('development', function () {
app.use(express.errorHandler());
});
var proxyCounter = 0;
app.all('/proxy/?*', function(req, res) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'GET,POST,PATCH,PUT,DELETE');
res.header('Access-Control-Allow-Headers', 'Authorization,Content-Type,Salesforceproxy-Endpoint,X- Authorization,X-SFDC-Session,SOAPAction');
if (req.method === 'OPTIONS') {
return res.end();
}
var contentType = "application/x-www-form-urlencoded";
var sfEndpoint = req.headers["salesforceproxy-endpoint"];
if (!/^https:\/\/[a-zA-Z0-9\.\-]+\.(force|salesforce|database)\.com\//.test(sfEndpoint)) {
return res.send(400, "Proxying endpoint is not allowed.");
}
var params = {
url: sfEndpoint || "https://login.salesforce.com//services/oauth2/token",
method: req.method,
headers: {
"Content-Type": req.headers["content-type"],
"Authorization": req.headers["x-authorization"] || req.headers.authorization,
"X-SFDC-Session": req.headers["x-sfdc-session"]
}
};
proxyCounter++;
console.log("(++req++) " + new Array(proxyCounter+1).join('*'));
console.log("method=" + params.method + ", url=" + params.url);
req.pipe(request(params))
.on('response', function() {
proxyCounter--;
console.log("(--res--) " + new Array(proxyCounter+1).join('*'));
})
.on('error', function() {
proxyCounter--;
console.log("(--err--) " + new Array(proxyCounter+1).join('*'));
})
.pipe(res);
});
app.get('/', function(req, res) {
res.render('client/main.html');
});
http.createServer(app).listen(app.get('port'), function () {
console.log("Express server listening on port " + app.get('port'));
});