aboutsummaryrefslogtreecommitdiff
path: root/newspipe/static/js
diff options
context:
space:
mode:
Diffstat (limited to 'newspipe/static/js')
-rw-r--r--newspipe/static/js/articles.js6
-rw-r--r--newspipe/static/js/config.js7
2 files changed, 10 insertions, 3 deletions
diff --git a/newspipe/static/js/articles.js b/newspipe/static/js/articles.js
index f1cee6e7..29ebac2e 100644
--- a/newspipe/static/js/articles.js
+++ b/newspipe/static/js/articles.js
@@ -86,7 +86,7 @@ Array.prototype.map.call(nodes, function(node) {
}
// sends the updates to the server
- fetch(API_ROOT + "article/" + article_id, {
+ fetch(prefix + API_ROOT + "article/" + article_id, {
method: "PUT",
headers: {
'Content-Type': 'application/json',
@@ -157,7 +157,7 @@ Array.prototype.map.call(nodes, function(node) {
}
// sends the updates to the server
- fetch(API_ROOT + "article/" + article_id, {
+ fetch(prefix + API_ROOT + "article/" + article_id, {
method: "PUT",
headers: {
'Content-Type': 'application/json',
@@ -189,7 +189,7 @@ Array.prototype.map.call(nodes, function(node) {
data = JSON.stringify(data);
// sends the updates to the server
- fetch(API_ROOT + "articles", {
+ fetch(prefix + API_ROOT + "articles", {
method: "DELETE",
headers: {
'Content-Type': 'application/json',
diff --git a/newspipe/static/js/config.js b/newspipe/static/js/config.js
new file mode 100644
index 00000000..7fad4388
--- /dev/null
+++ b/newspipe/static/js/config.js
@@ -0,0 +1,7 @@
+/*
+ * Set variables here for the javascript used by newspipe.
+ */
+var prefix = "/newspipe";
+
+/* Set exactly one trailing slash on prefix. */
+prefix = prefix.replace(/\/+$/,"/");
bgstack15