How to use relative path for css and images in jsreport, when converting HTML to PDF

I have locally hosted jsreport node application. I am using it to generate PDF from html. I would like to use relative URL for css, images and fonts in the HTML. Currently I am using absolute path with localhost. I have tried using / path without having localhost in url. But it doesnt work. Do I have to the files in specific folder?

You can use html base tag for this.

Just set the absolute address once and then use relative addresses

<head>
<base href="http://www.w3schools.com" target="_blank">
<link href="built.css" rel="stylesheet">
</head>

There is now automation wired in jsreport for this however you should be able to take base url from request header and easily replace it in html.