Hi,
First time posting here, glad to meet you all.
I was wondering about something. With my team, we are currently using a websocket gateway for the first time and we want to access to an environment variable to configure CORS.
It looks like something like that :
import { config } from '../../config/configuration';
@WebSocketGateway({
cors: {
credentials: true,
methods: ['GET'],
origin: config.client_base_url,
},
})
export class EventsGateway implements OnGatewayInit, OnGatewayConnection, OnGatewayDisconnect {
Where config is an export of our custom configuration file :
const configuration = (): CustomConfiguration => ({...})
export const config = configuration();
I would like to know if it is possible to use ConfigService instead of this workaround with configuration file.
Thanks for your help 🙂