More work on splitting roads, WIP; refactoring tests

This commit is contained in:
Pieter Vander Vennet 2021-09-22 05:02:09 +02:00
parent e374bb355c
commit 1f93923820
62 changed files with 1163 additions and 823 deletions

View file

@ -56,7 +56,7 @@ export default class ScriptUtils {
const headers = options?.headers ?? {}
headers.accept = "application/json"
console.log("Fetching", url)
const urlObj = new URL(url)
https.get({
host: urlObj.host,
@ -75,6 +75,7 @@ export default class ScriptUtils {
res.addListener('end', function () {
const result = parts.join("")
try {
console.log("Fetched", result)
resolve(JSON.parse(result))
} catch (e) {
console.error("Could not parse the following as JSON:", result)