const { Employee } = require('../models/database'); //... async store(req, res) { console.log(req.body); if(!req.body.name) { res.status(400); res.json({ success: false, message: 'Bad request' }); } const newEmployee = new Employee(req.body); const insertedEmployee = await newEmployee.save(); res.status(201) res.json({ success: true, message: insertedEmployee }); },