Skip to content

Commit b2cfa01

Browse files
committed
Use relative url for api requests
1 parent 3a8b30e commit b2cfa01

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

docs/app.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25481,7 +25481,7 @@ var receiveLibrary = function receiveLibrary(items) {
2548125481
var fetchLibrary = function fetchLibrary(id) {
2548225482
return function (dispatch) {
2548325483
dispatch(requestLibrary());
25484-
return (0, _isomorphicFetch2.default)('/library/js/' + id + '.json').then(function (response) {
25484+
return (0, _isomorphicFetch2.default)('library/js/' + id + '.json').then(function (response) {
2548525485
return response.json();
2548625486
}).then(function (items) {
2548725487
return dispatch(receiveLibrary(items));

docs/tutorial/index.html docs/tutorial.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
<title>Lambda Bricks</title>
44
<meta charset="UTF-8">
55

6-
<link rel="stylesheet" type="text/css" href="../styles.css">
7-
<link rel="stylesheet" type="text/css" href="../react-joyride-compiled.css">
6+
<link rel="stylesheet" type="text/css" href="./styles.css">
7+
<link rel="stylesheet" type="text/css" href="./react-joyride-compiled.css">
88
</head>
99
<body>
1010
<div id="main">
1111
<!-- The react App will be rendered here -->
1212
</div>
1313

14-
<script src="app.js"></script>
14+
<script src="tutorial.js"></script>
1515
</body>
1616
</html>

docs/tutorial/app.js docs/tutorial.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31495,7 +31495,7 @@ var receiveLibrary = function receiveLibrary(items) {
3149531495
var fetchLibrary = function fetchLibrary(id) {
3149631496
return function (dispatch) {
3149731497
dispatch(requestLibrary());
31498-
return (0, _isomorphicFetch2.default)('/library/js/' + id + '.json').then(function (response) {
31498+
return (0, _isomorphicFetch2.default)('library/js/' + id + '.json').then(function (response) {
3149931499
return response.json();
3150031500
}).then(function (items) {
3150131501
return dispatch(receiveLibrary(items));

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@
5151
"watchify": "^3.3.1"
5252
},
5353
"scripts": {
54-
"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"
54+
"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"
5555
}
5656
}

src/actions/requestLibraryActions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const receiveLibrary = (items) => {
2828
const fetchLibrary = (id) => {
2929
return dispatch => {
3030
dispatch(requestLibrary())
31-
return fetch(`/library/js/${id}.json`)
31+
return fetch(`library/js/${id}.json`)
3232
.then(response => response.json())
3333
.then(items => dispatch(receiveLibrary(items)))
3434
}

0 commit comments

Comments
 (0)