const cp = require( 'child_process' );
const fs = require( 'fs' );
const path = require( 'path' );
function constructor( fspath, retryAfter ) {
const child = cp.fork( path.join( __dirname, 'forked.js' ), [ fspath ] );
var childReady = false;
const cache = new Set( );
retryAfter = retryAfter ? retryAfter.toString( ) : '5';
child.on( 'message', function( data ) {
cache.add( data );
} );
return middleware;
function middleware( req, res, next ) {
// De momento, solo mostramos el URL.