Answer the question
In order to leave comments, you need to log in
Vue, for some reason I get 404 from axios?
Good evening.
I can't figure out why I'm getting an error in the console, does anyone know?
POST localhost:5000/api/auth/login 404 (Not Found)
login.vue
Vue.axios.post('/auth/login', this.user)
.then((response) => {
console.log("Logged in")
this.userLog = res.data
})
.catch((errors) => {
console.log("Cannot login") <--- Эта строка показывается в консоле
})
// localhost:5000/api/auth/login
app.use('/api/auth', authRoutes)
// localhost:5000/api/auth/login
router.post('/login', controller.login)
Answer the question
In order to leave comments, you need to log in
So you wrote "/auth/login" in the first line, shouldn't it be "/api/auth/login"?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question