const router = module.exports = require('express-promise-router')() const parseJSON = require('body-parser').json() const db = require('../db') const validate = require('./middleware/validators') router.use(require('./middleware/ensureCart')) router.put('/', async (req, res) => { const order = await db.order.create(req.cart.uuid); res.json(order) })