// Api for adding doctor
const addDoctor = async (req,res) => {
try {
const { name,email,password, speciality,degree,experience,about,fees,address } = req.body
const imageFile = req.file
console.log({ name,email,password, speciality,degree,experience,about,fees,address },imageFile);
} catch (error) {
}
}
export {addDoctor}
Output in the console
Server Started 4000
Database Connected
[nodemon] restarting due to changes...
[nodemon] starting `node server.js`
Server Started 4000
Database Connected
{
name: 'test name',
email: 'test email',
password: '12345678',
speciality: undefined,
degree: 'MBBS',
experience: '4 years',
about: 'test about',
fees: '40',
address: '"{"line 1": "address 1"}"'
} undefined
output of console.log(imageFile) is undefined ……………………………………………………………………..
3