node-express-boilerplate icon indicating copy to clipboard operation
node-express-boilerplate copied to clipboard

use express-async-errors instead of catchAsync

Open ciey opened this issue 2 years ago • 1 comments

const express = require('express');
require('express-async-errors');
const User = require('./models/user');
const app = express();
 
app.get('/users', async (req, res) => {
  const users = await User.findAll();
  res.send(users);
});

ciey avatar Dec 01 '22 02:12 ciey

100%

AlanGreyjoy avatar Feb 22 '23 03:02 AlanGreyjoy