当我在 Heroku 上部署 Node.js API 时,它给了我一个错误的响应。
res.json({"user":user,"auth-token":token});
本地主机:3000/auth/login
{
"user": {
"email": "name1@gmail.com",
"username": "name1",
"fullname": "fullname 1"
},
"auth-token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyaWQiOiI1ZjMxN2I0OTFhZTc4YzFjOWNjMjZjZWUiLCJ1c2VybmFtZSI6Im5pa2hpbGt1bWEiLCJmdWxsbmFtZSI6Ik5pa2hpbCBrdW1hciBTaW5naCIsImlhdCI6MTU5ODI0OTA3M30"
}
在heroku上部署后
name.herokuapp.com/auth/login
{
"user": {
"email": "name1@gmail.com",
"username": "name1",
"fullname": "fullname 1"
}
}