Skip to content

Commit 4f4cb01

Browse files
committed
refactor: Update all frontend API endpoints to CodeYourFuture backend
- Change getAllMessages() fetch URL from Render to CodeYourFuture hosting - Update like button fetch URL to CodeYourFuture backend - Update form submission fetch URL to CodeYourFuture backend - Enable frontend to communicate with CodeYourFuture deployed backend - Replace Render production URL with CodeYourFuture hosting domain
1 parent a80fe4f commit 4f4cb01

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

chat-app/frontend/script.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ let lastIdSeen = -1;
33
async function getAllMessages() {
44
try {
55
const response = await fetch(
6-
`https://iswanna-chat-app-backend.onrender.com/messages?since=${lastIdSeen}`,
6+
`https://iswanna-chat-app-backend.hosting.codeyourfuture.io//messages?since=${lastIdSeen}`,
77
);
88

99
const data = await response.json();
@@ -42,7 +42,7 @@ async function getAllMessages() {
4242

4343
likeButton.addEventListener("click", async () => {
4444
await fetch(
45-
`https://iswanna-chat-app-backend.onrender.com/messages/${message.id}/like`,
45+
`https://iswanna-chat-app-backend.hosting.codeyourfuture.io//messages/${message.id}/like`,
4646
{
4747
method: "POST",
4848
},
@@ -80,7 +80,7 @@ formElement.addEventListener("submit", async (event) => {
8080
try {
8181
// Send the data
8282
const response = await fetch(
83-
"https://iswanna-chat-app-backend.onrender.com/messages",
83+
"https://iswanna-chat-app-backend.hosting.codeyourfuture.io//messages",
8484
{
8585
method: "POST",
8686
headers: {

0 commit comments

Comments
 (0)