server.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { __decorate, __metadata } from "tslib";
  2. import { PlatformApplication } from '@tsed/common';
  3. import { Configuration, Inject } from '@tsed/di';
  4. import express from 'express';
  5. import '@tsed/swagger';
  6. import '@tsed/terminus';
  7. import * as Controllers from './controllers/index.js';
  8. import '@tsed/platform-express';
  9. const PORT = Number(process.env.PORT || 3010);
  10. let Server = class Server {
  11. app;
  12. };
  13. __decorate([
  14. Inject(),
  15. __metadata("design:type", PlatformApplication)
  16. ], Server.prototype, "app", void 0);
  17. Server = __decorate([
  18. Configuration({
  19. port: PORT,
  20. acceptMimes: ['application/json'],
  21. mount: {
  22. '/': [...Object.values(Controllers)],
  23. },
  24. middlewares: [
  25. 'json-parser',
  26. express.json({ limit: '50mb' }),
  27. express.urlencoded({ extended: true, limit: '50mb' }),
  28. ],
  29. swagger: [
  30. {
  31. path: '/v3/docs',
  32. specVersion: '3.0.1',
  33. },
  34. ],
  35. terminus: {
  36. signals: ['SIGINT', 'SIGTERM'],
  37. },
  38. })
  39. ], Server);
  40. export default Server;
  41. //# sourceMappingURL=server.js.map