You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi this is more of a question than an issue. I have the below project setup and want to create a global middleware. Since we are not using the express server separately as suggested here but rather through the cds runtime I have no idea how to register a middleware globally. Help would be really appreciated. Does anyone have an idea on this?
Thanks a lot in advance.
import'reflect-metadata';import{Application}from'express';import{useContainer}from'cds-routing-handlers';importContainerfrom'typedi';import{runJobs}from'../src/common/cron-service/cron-service.internal';import{isDevelopmentEnv,log,populateLocalUserScopes}from'../src/utils';useContainer(Container);//eslint-disable-next-lineconstproxy=require('@sap/cds-odata-v2-adapter-proxy');//eslint-disable-next-lineconstcds=require('@sap/cds');cds.on('bootstrap',(app: Application)=>{process.env.CDS_ASSERT_FORMAT_FLAGS='i';// this flag has default value of 'u' - unicode, therefore making the regex compilation failapp.use(proxy());});cds.once('listening',()=>{log.info('Scheduling cron jobs...');runJobs();});if(isDevelopmentEnv()){populateLocalUserScopes();}module.exports=cds.server;
The text was updated successfully, but these errors were encountered:
Hi this is more of a question than an issue. I have the below project setup and want to create a global middleware. Since we are not using the express server separately as suggested here but rather through the cds runtime I have no idea how to register a middleware globally. Help would be really appreciated. Does anyone have an idea on this?
Thanks a lot in advance.
The text was updated successfully, but these errors were encountered: