connect.use('/api', proxy(url.parse("https://google.com")));
^
TypeError: Object function createServer() {
function app(req, res){ app.handle(req, res); }
utils.merge(app, proto);
utils.merge(app, EventEmitter.prototype);
app.route = '/';
app.stack = [];
for (var i = 0; i < arguments.length; ++i) {
app.use(arguments[i]);
}
return app;
} has no method 'use'
at Object. (/home/projects/node/proxy.js:6:9)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:492:10)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
connect.use('/api', proxy(url.parse("https://google.com"))); ^ TypeError: Object function createServer() { function app(req, res){ app.handle(req, res); } utils.merge(app, proto); utils.merge(app, EventEmitter.prototype); app.route = '/'; app.stack = []; for (var i = 0; i < arguments.length; ++i) { app.use(arguments[i]); } return app; } has no method 'use' at Object. (/home/projects/node/proxy.js:6:9)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:492:10)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
var connect = require('connect') , url = require('url') , proxy = require('proxy-middleware')
var app = connect(); connect.use('/api', proxy(url.parse("https://google.com")));