diff options
Diffstat (limited to 'frontend/src/utils.js')
-rw-r--r-- | frontend/src/utils.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/frontend/src/utils.js b/frontend/src/utils.js index 2487f09..b72ada7 100644 --- a/frontend/src/utils.js +++ b/frontend/src/utils.js @@ -1,5 +1,5 @@ - export function createCurlCommand(subCommand, data) { - return `curl --request PUT \\\n --url ${window.location.hostname}/api${subCommand} \\\n ` + - `--header 'content-type: application/json' \\\n --data '${JSON.stringify(data)}'` + let full = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : ''); + return `curl --request PUT \\\n --url ${full}/api${subCommand} \\\n ` + + `--header 'content-type: application/json' \\\n --data '${JSON.stringify(data)}'`; } |