For this, the fix would be to add something like this on line 30:
const agent = (process.env.SPLUNKD_URL || 'https://localhost').startsWith('https')
In the following file https://github.com/splunk/dashpub/blob/master/template/src/pages/api/data/%5Bdsid%5D.js