middlewares() {
    // Pass the sentry as a middleware for the application
    // The errors protocolled by the sentry can be sent via Slack, email or other communications
    // apps, so the developer is informed about the error fast as possible
    // An integration with the Github is also possible, so everytime an error occur
    // will be created an issue for the project
    this.server.use(Sentry.Handlers.requestHandler());

    // The cors is needed to specify which address can access the API
    this.server.use(cors());

    // To allow the express aplication to recieve and send requests formatted as JSON
    this.server.use(express.json());

    // Define a route to give access to static files, such as images and other files
    this.server.use(
      '/files',
      express.static(path.resolve(__dirname, '..', 'tmp', 'uploads'))
    );
  }
// Resposable to save the middlewares that will be utilized by the application
Resposable to save the middlewares that will be utilized by the application
Resposable to save the middlewares that will be utilized by the application
middlewares() {
    this.server.use(Sentry.Handlers.requestHandler());
    this.server.use(cors());
    this.server.use(express.json());
    this.server.use(
      '/files',
      express.static(path.resolve(__dirname, '..', 'tmp', 'uploads'))
    );
  }
middlewares ( ) { this . server . use ( Sentry . Handlers . requestHandler ( ) ) ; this . server . use ( cors ( ) ) ; this . server . use ( express . json ( ) ) ; this . server . use ( '/files' , express . static ( path . resolve ( __dirname , '..' , 'tmp' , 'uploads' ) ) ) ; }
Resposable to save the middlewares that will be utilized by the application
Resposable to save the middlewares that will be utilized by the application
// Pass the sentry as a middleware for the application // The errors protocolled by the sentry can be sent via Slack, email or other communications // apps, so the developer is informed about the error fast as possible // An integration with the Github is also possible, so everytime an error occur // will be created an issue for the project // The cors is needed to specify which address can access the API // To allow the express aplication to recieve and send requests formatted as JSON // Define a route to give access to static files, such as images and other files