D
Size: a a a
MZ
MZ
t
MZ
MZ
MZ
MZ
router.get("/recipe", (req, res) => {
const id = req.headers.id
Recipe.findOne({_id: id})
.then(recipeId => {
res.json({recipeId})
console.log(id)
})
.catch(err => {
console.log(err)
})
})
S
router.get("/recipe", (req, res) => {
const id = req.headers.id
Recipe.findOne({_id: id})
.then(recipeId => {
res.json({recipeId})
console.log(id)
})
.catch(err => {
console.log(err)
})
})
MZ
useEffect(() => {
fetch("/recipe", {
headers : {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Id': '5fadc3669d45162b23f644a9'
},
})
.then(res => res.json())
.then(result => {
setRecipe(result.recipeId)
})
},[])
S
useEffect(() => {
fetch("/recipe", {
headers : {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Id': '5fadc3669d45162b23f644a9'
},
})
.then(res => res.json())
.then(result => {
setRecipe(result.recipeId)
})
},[])