Closed jcblw closed 9 years ago
two things:
1) for security and compatibility reasons we should be using a module like st
, ecstatic
or serve
2) for the js api, static
should take a string of the path to server, only the bin should rely on process.cwd()
. libs should have as few side effects as possible
Ok everything seems to be fixed up, the example is slightly different.
var run = require( '../' );
var browser = run( {
static: process.cwd()
} );
browser.pipe( process.stdout );
browser.write(
'var img = document.createElement( \'img\' ); ' +
'img.onload = function(){ console.log( \'img loaded\' )}; ' +
'img.onerror = function( err ){ console.log( \'img errored\', err )}; ' +
'img.src = \'./examples/foo.png\'; ' +
'document.body.appendChild( img );'
);
browser.end();
Also whats going on with the test? Is this something I should be concerned with, seems as though there is a missing .travis.yml
thanks! published as 0.5.0
This is allows you to serve up static resources using the same server that browser-run is using.
example usage
If the resource is there then it will log "image loaded"
Also I was thinking on how we could test this let me know if you have any ideas
once this is merged I think I can have a pr ready for
tape-run
to be able to pass this flag.