5bb26cc53a
Signed-off-by: mikesir87 <mikesir87@gmail.com> Imported from dockersamples/101-tutorial, removed other languages for now, and replaced PWD references with Docker Desktop.
14 lines
266 B
JavaScript
14 lines
266 B
JavaScript
const db = require('../persistence');
|
|
const uuid = require('uuid/v4');
|
|
|
|
module.exports = async (req, res) => {
|
|
const item = {
|
|
id: uuid(),
|
|
name: req.body.name,
|
|
completed: false,
|
|
};
|
|
|
|
await db.storeItem(item);
|
|
res.send(item);
|
|
};
|