From f5a220fa7a0aacab2351480a48c0d31641d72d55 Mon Sep 17 00:00:00 2001 From: Amar Date: Sun, 25 Aug 2024 11:39:00 +0530 Subject: [PATCH] changes backend end point --- frontend/src/common/index.jsx | 2 +- frontend/src/pages/Login.jsx | 7 ++++--- frontend/src/pages/Signup.jsx | 5 +++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/frontend/src/common/index.jsx b/frontend/src/common/index.jsx index df30fc3..e262344 100644 --- a/frontend/src/common/index.jsx +++ b/frontend/src/common/index.jsx @@ -1,4 +1,4 @@ -const backendDomain = 'http://localhost:5000'; +const backendDomain = 'http://my-backend-app-env.eba-qrjj9aqa.ap-south-1.elasticbeanstalk.com'; // const backendDomain = 'http://192.168.45.146:5000'; const summaryApi = { diff --git a/frontend/src/pages/Login.jsx b/frontend/src/pages/Login.jsx index bf1137a..9d080b4 100644 --- a/frontend/src/pages/Login.jsx +++ b/frontend/src/pages/Login.jsx @@ -3,6 +3,7 @@ import signin from '../asset/signin.gif' import { Link , useNavigate} from 'react-router-dom'; import { toast } from "react-toastify"; import context from '../context/index.js'; +import summaryApi from '../common/index.jsx'; import './pages.css' @@ -29,9 +30,9 @@ const handleOnChange =(e) =>{ const handleSubmit = async (e) =>{ e.preventDefault(); - const dataResponse = await fetch('http://localhost:5000/api/signin',{ - // const dataResponse = await fetch('http://192.168.45.146:5000/api/signin',{ - method:"post", + const dataResponse = await fetch(summaryApi.signIn.url,{ + + method:summaryApi.signIn.method, credentials:'include', headers:{ 'Content-Type':'application/json' diff --git a/frontend/src/pages/Signup.jsx b/frontend/src/pages/Signup.jsx index 694d3ce..8d5af70 100644 --- a/frontend/src/pages/Signup.jsx +++ b/frontend/src/pages/Signup.jsx @@ -1,6 +1,7 @@ import React, { useState } from "react"; import signin from "../asset/signin.gif"; import { Link, useNavigate } from "react-router-dom"; +import summaryApi from "../common/index.jsx"; import "./pages.css"; @@ -34,8 +35,8 @@ const signup = () => { e.preventDefault(); if (data.password === data.confirmpassword) { - const dataResponse = await fetch("http://localhost:5000/api/signup", { - method: "post", + const dataResponse = await fetch(summaryApi.signUp.url, { + method: summaryApi.signUp.method, headers: { "Content-Type": "application/json", },