а фронт у тебя тут ? localhost:5173да, конечно. Иначе я бы поймал CORS.
try{
axios.post('http://127.0.0.1:8000/login',formData,{
headers:{
'Access-Control-Allow-Origin': '*',
'Content-Type': 'application/json',
},
withCredentials:true,
}).then(resp=>{
console.log(resp);
})
const express = require('express')
const app = express()
const port = 3000
app.get('/', (req, res) => {
res.send('Hello World!')
})
app.listen(port, () => {
console.log(`Example app listening on port ${port}`)
})