Browse Source

Feature/refactor to use body-parser.json supplied from Nest

It's not required to handle that dependency manually as Nest
(platform-express) supports that via this helper method.

The version in use will be controlled by @nestjs/platform-express and is
currently the same as the removed one.

One thing less to worry about.
pull/4155/head
Szymon Łągiewka 8 months ago
parent
commit
081c79628b
Failed to extract signature
  1. 1
      CHANGELOG.md
  2. 3
      apps/api/src/main.ts
  3. 2
      package-lock.json
  4. 2
      package.json

1
CHANGELOG.md

@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Upgraded `ngx-markdown` from version `18.0.0` to `19.0.0`
- Upgraded `Nx` from version `20.1.2` to `20.3.0`
- Upgraded `zone.js` from version `0.14.10` to `0.15.0`
- Switched to using JSON body parser from NestJS
## 2.131.0 - 2024-12-25

3
apps/api/src/main.ts

@ -7,7 +7,6 @@ import {
import { ConfigService } from '@nestjs/config';
import { NestFactory } from '@nestjs/core';
import type { NestExpressApplication } from '@nestjs/platform-express';
import { json } from 'body-parser';
import helmet from 'helmet';
import { AppModule } from './app/app.module';
@ -48,7 +47,7 @@ async function bootstrap() {
);
// Support 10mb csv/json files for importing activities
app.use(json({ limit: '10mb' }));
app.useBodyParser('json', { limit: '10mb' });
if (configService.get<string>('ENABLE_FEATURE_SUBSCRIPTION') === 'true') {
app.use(

2
package-lock.json

@ -46,7 +46,6 @@
"@stripe/stripe-js": "5.4.0",
"alphavantage": "2.2.0",
"big.js": "6.2.2",
"body-parser": "1.20.2",
"bootstrap": "4.6.0",
"bull": "4.16.2",
"cache-manager": "5.7.6",
@ -127,7 +126,6 @@
"@storybook/core-server": "8.4.7",
"@trivago/prettier-plugin-sort-imports": "4.3.0",
"@types/big.js": "6.2.2",
"@types/body-parser": "1.19.5",
"@types/cache-manager": "4.0.6",
"@types/color": "3.0.6",
"@types/google-spreadsheet": "3.1.5",

2
package.json

@ -92,7 +92,6 @@
"@stripe/stripe-js": "5.4.0",
"alphavantage": "2.2.0",
"big.js": "6.2.2",
"body-parser": "1.20.2",
"bootstrap": "4.6.0",
"bull": "4.16.2",
"cache-manager": "5.7.6",
@ -173,7 +172,6 @@
"@storybook/core-server": "8.4.7",
"@trivago/prettier-plugin-sort-imports": "4.3.0",
"@types/big.js": "6.2.2",
"@types/body-parser": "1.19.5",
"@types/cache-manager": "4.0.6",
"@types/color": "3.0.6",
"@types/google-spreadsheet": "3.1.5",

Loading…
Cancel
Save