From b2cfa01fee0f3f0fd00aaa22d9176534d71071a3 Mon Sep 17 00:00:00 2001 From: Daniel Garcia Date: Sun, 8 Dec 2019 16:17:55 -0800 Subject: [PATCH] Use relative url for api requests --- docs/app.js | 2 +- docs/{tutorial/index.html => tutorial.html} | 6 +++--- docs/{tutorial/app.js => tutorial.js} | 2 +- package.json | 2 +- src/actions/requestLibraryActions.js | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) rename docs/{tutorial/index.html => tutorial.html} (50%) rename docs/{tutorial/app.js => tutorial.js} (99%) diff --git a/docs/app.js b/docs/app.js index b7542dc..7334023 100644 --- a/docs/app.js +++ b/docs/app.js @@ -25481,7 +25481,7 @@ var receiveLibrary = function receiveLibrary(items) { var fetchLibrary = function fetchLibrary(id) { return function (dispatch) { dispatch(requestLibrary()); - return (0, _isomorphicFetch2.default)('/library/js/' + id + '.json').then(function (response) { + return (0, _isomorphicFetch2.default)('library/js/' + id + '.json').then(function (response) { return response.json(); }).then(function (items) { return dispatch(receiveLibrary(items)); diff --git a/docs/tutorial/index.html b/docs/tutorial.html similarity index 50% rename from docs/tutorial/index.html rename to docs/tutorial.html index 68327f4..c2359da 100644 --- a/docs/tutorial/index.html +++ b/docs/tutorial.html @@ -3,14 +3,14 @@ Lambda Bricks - - + +
- + diff --git a/docs/tutorial/app.js b/docs/tutorial.js similarity index 99% rename from docs/tutorial/app.js rename to docs/tutorial.js index 4a7008a..522a220 100644 --- a/docs/tutorial/app.js +++ b/docs/tutorial.js @@ -31495,7 +31495,7 @@ var receiveLibrary = function receiveLibrary(items) { var fetchLibrary = function fetchLibrary(id) { return function (dispatch) { dispatch(requestLibrary()); - return (0, _isomorphicFetch2.default)('/library/js/' + id + '.json').then(function (response) { + return (0, _isomorphicFetch2.default)('library/js/' + id + '.json').then(function (response) { return response.json(); }).then(function (items) { return dispatch(receiveLibrary(items)); diff --git a/package.json b/package.json index 0775cb9..5146931 100644 --- a/package.json +++ b/package.json @@ -51,6 +51,6 @@ "watchify": "^3.3.1" }, "scripts": { - "start": "watchify --extension=js -o docs/app.js src/index.js & watchify --extension=js -o docs/tutorial/app.js src/tutorial-index.js & http-server docs" + "start": "watchify --extension=js -o docs/app.js src/index.js & watchify --extension=js -o docs/tutorial.js src/tutorial-index.js & http-server docs" } } diff --git a/src/actions/requestLibraryActions.js b/src/actions/requestLibraryActions.js index 9974ae6..4dc2592 100644 --- a/src/actions/requestLibraryActions.js +++ b/src/actions/requestLibraryActions.js @@ -28,7 +28,7 @@ const receiveLibrary = (items) => { const fetchLibrary = (id) => { return dispatch => { dispatch(requestLibrary()) - return fetch(`/library/js/${id}.json`) + return fetch(`library/js/${id}.json`) .then(response => response.json()) .then(items => dispatch(receiveLibrary(items))) }