I am currently utilizing NestJS with HTTPS for my project.
import { NestFactory } from '@nestjs/core';
import { fstat } from 'fs';
import { AppModule } from './app.module';
{readFileSync} from 'fs'
async function bootstrap() {
const httpsOptions = {
key:readFileSync('tsl/private-key.pem'),
cert:readFileSync('tsl/public-cert.pem')
}
const app = await NestFactory.create(AppModule,{httpsOptions});
await app.listen(3000);
}
bootstrap();
I am attempting to make a simple POST request:
@Post()
test(@Body() body){
console.log(body);
}
However, the output always shows as {}
POSTMAN: https://i.sstatic.net/6JC4B.png
I have learned that NestJS is unable to parse data correctly. How can I resolve this issue?