Skip to content

Commit 30cab41

Browse files
author
Alex Patterson
committed
adjust endpoint
1 parent df97a1d commit 30cab41

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pages/book.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,22 @@ class book extends Component<
5656
console.log('Server only call.');
5757
if (id) {
5858
const res = await fetch(
59-
`http://localhost:5001/ajonp-ajs-books/us-central1/api/book?id=${id}`
59+
// Local example http://localhost:5001/ajonp-ajs-books/us-central1/api/
60+
`https://us-central1-ajonp-ajs-books.cloudfunctions.net/api/book?id=${id}`
6061
);
6162
const json = await res.json();
6263
retObj.book = json;
6364
}
6465
if (chapterId) {
6566
const res = await fetch(
66-
`http://localhost:5001/ajonp-ajs-books/us-central1/api/chapter?id=${id}&chapterId=${chapterId}`
67+
`https://us-central1-ajonp-ajs-books.cloudfunctions.net/api/chapter?id=${id}&chapterId=${chapterId}`
6768
);
6869
const json = await res.json();
6970
retObj.chapter = json;
7071
}
7172
if (pageId) {
7273
const res = await fetch(
73-
`http://localhost:5001/ajonp-ajs-books/us-central1/api/page?id=${id}&chapterId=${chapterId}&pageId=${pageId}`
74+
`https://us-central1-ajonp-ajs-books.cloudfunctions.net/api/page?id=${id}&chapterId=${chapterId}&pageId=${pageId}`
7475
);
7576
const json = await res.json();
7677
retObj.page = json;

0 commit comments

Comments
 (0)