Skip to content

Commit 4e95752

Browse files
committed
Backend enpoint updated
1 parent 9b67aff commit 4e95752

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

client/src/App.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class App extends React.Component {
2828
};
2929
if (login) {
3030
axios
31-
.post(`http://localhost:5001/api/authenticate`, user)
31+
.post(`/api/authenticate`, user)
3232
.then((res) => {
3333
if (res.status === 200) {
3434
this.setState({ route: "blog", name: res.data.name });
@@ -51,7 +51,7 @@ class App extends React.Component {
5151
return;
5252
}
5353
axios
54-
.post(`http://localhost:5001/api/register`, user)
54+
.post(`/api/register`, user)
5555
.then((res) => {
5656
if (res.status === 200) {
5757
alert("Registered Successfully! Welcome to Blog Planet ");

client/src/components/BlogContainer.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Blog_Container extends React.Component {
1616
};
1717

1818
componentDidMount() {
19-
axios.get(`http://localhost:5001/api`).then((res) => {
19+
axios.get(`/api`).then((res) => {
2020
this.setState({ blogs: res.data });
2121
});
2222
}
@@ -31,7 +31,7 @@ class Blog_Container extends React.Component {
3131

3232
addBlog = (item) => {
3333
axios
34-
.post(`http://localhost:5001/api`, item)
34+
.post(`/api`, item)
3535
.then((res) => {
3636
alert(`Hi, ${item.name} your blog has been published`);
3737
this.setState(
@@ -49,7 +49,7 @@ class Blog_Container extends React.Component {
4949

5050
updateBlog = (item, id) => {
5151
axios
52-
.put(`http://localhost:5001/api/${id}`, item)
52+
.put(`/api/${id}`, item)
5353
.then((res) => {
5454
alert(`Hi, ${item.name} your blog has been edited.`);
5555
this.setState(

0 commit comments

Comments
 (0)