I use axios to send a post request in vue to express, but it doesnt work the backend doesnt respond by the message so it isnt sent to frontend and "posted" not printed in the console, however when i post request by postman it works and "posted" is printed.
code in vue.js (frontend)
post(){ //from vue to express
this.information = {email:this.email, username:this.username, password:this.password}
axios.post("http://localhost:8081/register", this.information)
.then(response => this.msg= response.data.messeage);
}
code in express (backend)
app.post('/register',(req,res) => {
console.log("posted")
res.send({
messeage: "heloooooo"
})
})