connected backend to frontend for writing microblogs

This commit is contained in:
Aditya Sankaran
2019-09-30 18:06:23 -04:00
parent b1faacd312
commit 55dc62e57e
5 changed files with 39 additions and 7 deletions

View File

@@ -27,12 +27,19 @@ class Writing_Microblogs extends Component {
handleSubmit(event) {
// alert('A title for the microblog was inputted: ' + this.state.title + '\nA microblog was posted: ' + this.state.value);
const response = await axios.post(
const response = axios.post(
'http://localhost:5001/twistter-e4649/us-central1/api/putPost',
{ },
{ body: this.state.value,
userHandle: "new user",
userImage: "bing-url",
microBlogTitle: this.state.title
},
{ headers: { 'Content-Type': 'application/json'} }
)
console.log(response.data);
event.preventDefault();
}