Skip to content

Commit b28d156

Browse files
committed
update env for deployment
1 parent 5b50fbd commit b28d156

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

src/App.js

-3
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@ import UpdatePage from "./components/UpdatePage/UpdatePage";
99
import { ChakraProvider } from "@chakra-ui/react";
1010
import "leaflet/dist/leaflet.css";
1111
import { AuthContextProvider } from "./context/AuthContext";
12-
import { UserAuth } from "./context/AuthContext";
1312
import AboutPage from "./components/AboutPage/AboutPage";
1413

1514
function App() {
16-
const { user } = UserAuth();
17-
console.log(user);
1815
return (
1916
<AuthContextProvider>
2017
<ChakraProvider>

src/components/Home/Home.jsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,13 @@ export default function Home() {
129129
data.sort(compareDates);
130130

131131
//get data
132+
console.log(
133+
`http://${process.env.REACT_APP_AWS_BACKEND_URL}/items/`
134+
);
132135
useEffect(() => {
133136
const getData = async () => {
134137
axios
135-
.get("http://localhost:3001/items")
138+
.get(`http://${process.env.REACT_APP_AWS_BACKEND_URL}/items/`)
136139
.then((obj) => {
137140
console.log("s", obj.data);
138141
setData(obj.data.map((item) => ({ ...item, id: item.id })));
@@ -154,7 +157,9 @@ export default function Home() {
154157
let userEmail = user.email;
155158
if (user) {
156159
axios
157-
.post("http://localhost:5000/send_email", { userEmail })
160+
.post(`http://${process.env.REACT_APP_AWS_BACKEND_URL}/send_email`, {
161+
userEmail,
162+
})
158163
.then(() => alert("Email Sent Successfully!"))
159164
.catch(() => alert("Email NOT SENT"));
160165
}

src/components/InfoModal/InfoModal.jsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ export default function InfoModal({ setData, isOpen, onClose, props }) {
3737
onClose();
3838
setLoading(false);
3939
axios
40-
.delete(`http://localhost:3001/items/${props.id}`)
40+
.delete(
41+
`http://${process.env.REACT_APP_AWS_BACKEND_URL}/items/${props.id}`
42+
)
4143
.then(() => console.log("Success"))
4244
.catch((err) => console.log(err));
4345
setData((prevItems) => {

src/components/Map/Map.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export default function Map({
111111
const date = new Date();
112112

113113
axios
114-
.post("http://localhost:3001/items", {
114+
.post(`http://${process.env.REACT_APP_AWS_BACKEND_URL}/items`, {
115115
image: newAddedItem.image,
116116
type: newAddedItem.type,
117117
islost: newAddedItem.islost,

0 commit comments

Comments
 (0)