set is not being exposed in order to add custom config to express such as trust proxy
const your = (code) => here;
Being able to set express config such as trust proxy, views etc
Nest version: X.Y.Z
For Tooling issues:
- Node version: XX
- Platform:
Others:
See this https://docs.nestjs.com/first-steps#platform
const app = await NestFactory.create<NestExpressApplication>(ApplicationModule);
Hi what i mean is this:
https://expressjs.com/en/4x/api.html#app.set
This seems to work.. not sure if this is recommended
const server = express();
server.set('trust proxy', 1);
const app = await NestFactory.create(AppModule, new ExpressAdapter(server), {
logger,
httpsOptions: environment.httpsOptions,
});
That's strange because the old nestjs version had set, now it's not exposed and it's very useful for this like trust proxy
Nest should not be dependent on express.. It makes total sense
Yes but since nest uses mainly it and set is one of the most used things, there's no problem on exposing it that's what i mean
Gonna have to agree to disagree on this one 馃槈
There is a set
method, but you have to use NestExpressApplication
interface. See here https://docs.nestjs.com/first-steps#platform
const app = await NestFactory.create<NestExpressApplication>(ApplicationModule);
app.set(...)
this is much better than what im doing
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
There is a
set
method, but you have to useNestExpressApplication
interface. See here https://docs.nestjs.com/first-steps#platform