From: Brendan Hansen Date: Mon, 6 Sep 2021 12:31:04 +0000 (-0500) Subject: added ROOT_ENDPOINT to example endpoints X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=81decb346adcbd4d1c3de5e3ecaa04b73e3faa33;p=onyx-live.git added ROOT_ENDPOINT to example endpoints --- diff --git a/static/src/index.js b/static/src/index.js index b7bd57f..62c7734 100644 --- a/static/src/index.js +++ b/static/src/index.js @@ -231,7 +231,7 @@ function submit_input() { } function populate_examples() { - fetch("/list_examples") + fetch(ROOT_ENDPOINT + "/list_examples") .then(x => x.json()) .then(examples => { let $selector = $("#examples-selector"); @@ -250,7 +250,7 @@ function load_example() { let example = $selector.val(); if (example == "---") return; - fetch(`/example?example=${example}`) + fetch(`${ROOT_ENDPOINT}/example?example=${example}`) .then(x => x.text()) .then(text => { let editor = ace.edit('code-editor');