Skip to content

Commit

Permalink
Use relative url for api requests
Browse files Browse the repository at this point in the history
  • Loading branch information
pel-daniel committed Dec 9, 2019
1 parent 3a8b30e commit b2cfa01
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
6 changes: 3 additions & 3 deletions docs/tutorial/index.html → docs/tutorial.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<title>Lambda Bricks</title>
<meta charset="UTF-8">

<link rel="stylesheet" type="text/css" href="../styles.css">
<link rel="stylesheet" type="text/css" href="../react-joyride-compiled.css">
<link rel="stylesheet" type="text/css" href="./styles.css">
<link rel="stylesheet" type="text/css" href="./react-joyride-compiled.css">
</head>
<body>
<div id="main">
<!-- The react App will be rendered here -->
</div>

<script src="app.js"></script>
<script src="tutorial.js"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion docs/tutorial/app.js → docs/tutorial.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion src/actions/requestLibraryActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
}
Expand Down

0 comments on commit b2cfa01

Please sign in to comment.