Open thecatontheflat opened 9 years ago
https://github.com/runk/connect-jade-static/blob/master/index.js#L54
I think it would make sense to perform a simple string operation here:
var urlpath = parsed.pathname.replace(/html$/, 'jade').replace(opts.baseUrl, '');
As far as I understood - the logic is to replace the string from the end. It can be achieved in more efficient ways :) I'll create a PR later
Sure, all improvements are welcome :+1:
I've updated my PR https://github.com/runk/connect-jade-static/pull/6
https://github.com/runk/connect-jade-static/blob/master/index.js#L54
I think it would make sense to perform a simple string operation here:
var urlpath = parsed.pathname.replace(/html$/, 'jade').replace(opts.baseUrl, '');
As far as I understood - the logic is to replace the string from the end. It can be achieved in more efficient ways :) I'll create a PR later