Skip to content

Commit 9786d85

Browse files
committed
add backend deployed link to the front end
1 parent fcd675b commit 9786d85

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/components/Home.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const Home = ()=>{
1515
},[])
1616

1717
const getPosts=()=>{
18-
axios.get('http://localhost:5000/travelposts')
18+
axios.get('https://smart-travel-hub-backend.herokuapp.com/travelposts')
1919
.then((res)=>{
2020

2121
setPosts(res.data)
@@ -26,7 +26,7 @@ const Home = ()=>{
2626
}
2727
const searchPosts=(val)=>{
2828
if(val){
29-
axios.get(`http://localhost:5000/travelposts/search/${val}`)
29+
axios.get(`https://smart-travel-hub-backend.herokuapp.com/travelposts/search/${val}`)
3030
.then(res=>{
3131

3232

src/components/PostCard.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const PostCard = ()=>{
1212
console.log({id})
1313
const [travelPosts,setTravelPosts] =useState([])
1414
useEffect(()=>{
15-
axios.get(`http://localhost:5000/travelposts/${id}`)
15+
axios.get(`https://smart-travel-hub-backend.herokuapp.com/travelposts/${id}`)
1616
.then(res=>{
1717

1818
setTravelPosts(res.data)

src/components/PostForm.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const PostForm =()=>{
6767

6868
dataInputs.day=values;
6969

70-
axios.post('http://localhost:5000/travelposts',{
70+
axios.post('https://smart-travel-hub-backend.herokuapp.com/travelposts',{
7171
title:dataInputs.title,
7272
country:dataInputs.country,
7373
state:dataInputs.state,

src/components/PostList.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const PostList = ({searchResult,posts,refresh})=>{
1212
if(post_id == posts[i].id){
1313

1414
posts[i].likes+=1
15-
axios.patch(`http://localhost:5000/travelposts/${post_id}`,{
15+
axios.patch(`https://smart-travel-hub-backend.herokuapp.com/travelposts/${post_id}`,{
1616
likes_count:posts[i].likes
1717
})
1818
.then(()=>{

0 commit comments

Comments
 (0)