Skip to content

Commit 7d971b1

Browse files
Remove any reference to http://localhost:3000
1 parent a5f4711 commit 7d971b1

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

step-2/readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ Nous utilisons `fetch` pour effectuer les appels Ajax. Par exemple pour charger
216216
const WineApp = React.createClass({
217217
// ...
218218
componentDidMount() {
219-
fetch('http://localhost:3000/api/regions')
219+
fetch('/api/regions')
220220
.then(r => r.json())
221221
.then(data => {
222222
this.setState({

step-6-done/src/components/wine.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export const Wine = React.createClass({
7373
return (
7474
<div style={Styles.Card}>
7575
<img style={Styles.Image}
76-
src={`http://localhost:3000/api/wines/${wine.id}/image`}
76+
src={`/api/wines/${wine.id}/image`}
7777
/>
7878
<div style={Styles.Title}>{wine.name}</div>
7979
<div style={Styles.Info}>

step-7/src/actions/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export function fetchWine(wineId) {
197197
export function toggleWineLiked() {
198198
return (dispatch, state) => {
199199
const currentLike = state().currentWine.liked;
200-
fetch(`http://localhost:3000/api/wines/${state().currentWine.wine.id}/like`, {
200+
fetch(`/api/wines/${state().currentWine.wine.id}/like`, {
201201
method: 'post',
202202
headers: {
203203
'Accept': 'application/json',
@@ -221,7 +221,7 @@ export function toggleWineLiked() {
221221

222222
export function fetchWineLiked() {
223223
return (dispatch, state) => {
224-
fetch(`http://localhost:3000/api/wines/${state().currentWine.wine.id}/like`)
224+
fetch(`/api/wines/${state().currentWine.wine.id}/like`)
225225
.then(r => r.json())
226226
.then(data => {
227227
dispatch(setCurrentLiked(data.like));
@@ -232,7 +232,7 @@ export function fetchWineLiked() {
232232

233233
export function fetchComments(wineId) {
234234
return (dispatch, state) => {
235-
fetch(`http://localhost:3000/api/wines/${wineId}/comments`)
235+
fetch(`/api/wines/${wineId}/comments`)
236236
.then(r => r.json())
237237
.then(comments => {
238238
dispatch(setCurrentComments(comments.sort((a, b) => new Date(b.date) - new Date(a.date))));
@@ -243,7 +243,7 @@ export function fetchComments(wineId) {
243243

244244
export function postComment(wineId, comment) {
245245
return (dispatch, state) => {
246-
fetch(`http://localhost:3000/api/wines/${wineId}/comments`, {
246+
fetch(`/api/wines/${wineId}/comments`, {
247247
method: 'post',
248248
headers: {
249249
'Accept': 'application/json',

step-7/src/components/wine.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export const Wine = React.createClass({
7373
return (
7474
<div style={Styles.Card}>
7575
<img style={Styles.Image}
76-
src={`http://localhost:3000/api/wines/${wine.id}/image`}
76+
src={`/api/wines/${wine.id}/image`}
7777
/>
7878
<div style={Styles.Title}>{wine.name}</div>
7979
<div style={Styles.Info}>

0 commit comments

Comments
 (0)