How to use the @decorators/express.Get function in @decorators/express

To help you get started, we’ve selected a few @decorators/express examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github serhiisol / node-decorators / playground / express / index.ts View on Github external
}

@Injectable()
class ServerErrorMiddleware implements ErrorMiddleware {

  async use(error, _req, res) {
    await emulatedRequest();

    res.status(500).send(error.toString());
  }
}

@Controller('/')
class UserController {

  @Get('/')
  getData(@Response() res) {
    throw new Error('Handler error');
  }

}

/**
 * Server configuration
 */

const app: express.Express = express();

app.set('env', 'test');

Container.provide([
  {

@decorators/express

node decorators - decorators for express library

MIT
Latest version published 1 year ago

Package Health Score

51 / 100
Full package analysis