I decided to try async / await, but ran into a problem:
router.get('/api/bookmarks-theme/', async function a (req, res, next) { ^^^^^ SyntaxError: missing ) after argument list .babelrc:
{ "presets": ["es2015", "stage-3"], "plugins": [ "add-module-exports", "transform-async-to-generator", "syntax-async-functions", "transform-regenerator", "transform-runtime" ] } Method in the route:
router.get('/api/bookmarks-theme/', async function a (req, res, next) { BookmarkTheme.find({}, (err, data) => { if (err) return next(err); res.json(data); }); }); What is the problem ?
=>? - Grundy