Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support instrumentation via proxy, instead of from file system #30

Open
lenntt opened this issue Sep 9, 2016 · 0 comments
Open

Support instrumentation via proxy, instead of from file system #30

lenntt opened this issue Sep 9, 2016 · 0 comments

Comments

@lenntt
Copy link

lenntt commented Sep 9, 2016

I'd like to instrument code from an existing webserver (that has complex virtual dirs etc), instead of using the file system directly.

I don't think this is currently possible:
http://stackoverflow.com/questions/39330914/getting-browser-test-coverage-via-a-proxy-with-istanbul-middleware

perhaps using express-http-proxy, make an example like this could work??

var path = require('path');
var im = require('istanbul-middleware');
var proxy = require('express-http-proxy');
var express = require('express');

var app = express();
var proxy = proxy('localhost:8383');
im.hookLoader(proxy);

app.use('/coverage', im.createHandler());
app.use( im.createClientHandler(proxy) );

app.listen(8889);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant