From 6315fba9a83bb3e24193f35421ec8a41dde6c5ad Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 5 Jan 2018 08:43:07 +0100 Subject: db url --- client/db.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'client') diff --git a/client/db.js b/client/db.js index 5d34e15..ee31d0d 100644 --- a/client/db.js +++ b/client/db.js @@ -1,6 +1,12 @@ function fetchDB(cb) { let raw_db; - fetch('/db.json', { + let url; + if (window.location.origin.match('paintings.asdf.us')) { + url = '/db.json' + } else { + url = '/paintings/db.json' + } + fetch(url, { method: 'GET' }).then(res => { if (res.status !== 200) { -- cgit v1.2.3-70-g09d2