feat: add body size limit config as env var
This commit is contained in:
parent
77479b8a5d
commit
2e433c3233
@ -12,8 +12,6 @@ It can be used with [kiliandeca/excalidraw-fork](https://gitlab.com/kiliandeca/e
|
|||||||
| --------------- | ------------------------------------------------------------ | ---------------- |
|
| --------------- | ------------------------------------------------------------ | ---------------- |
|
||||||
| `PORT` | Server listening port | 8080 |
|
| `PORT` | Server listening port | 8080 |
|
||||||
| `GLOBAL_PREFIX` | API global prefix for every routes | `/api/v2` |
|
| `GLOBAL_PREFIX` | API global prefix for every routes | `/api/v2` |
|
||||||
| `STORAGE_URI` | [Keyv](https://github.com/jaredwray/keyv) connection string | `""` (in memory) |
|
| `STORAGE_URI` | [Keyv](https://github.com/jaredwray/keyv) connection string, example: `redis://user:pass@localhost:6379`. Availabe Keyv storage adapter: redis, mongo, postgres and mysql | `""` (in memory **non-persistent**) |
|
||||||
| `LOG_LEVEL` | Log level (`debug`, `verbose`, `log`, `warn`, `error`) | `warn` |
|
| `LOG_LEVEL` | Log level (`debug`, `verbose`, `log`, `warn`, `error`) | `warn` |
|
||||||
|
| `BODY_LIMIT` | Payload size limit for scenes or images | `50mb` |
|
||||||
|
|
||||||
Availabe Keyv storage adapter: redis, mongo, postgres and mysql
|
|
||||||
|
@ -4,7 +4,10 @@ import { hasBody } from 'type-is';
|
|||||||
|
|
||||||
// Excalidraw Front end doesn't send a Content Type Header
|
// Excalidraw Front end doesn't send a Content Type Header
|
||||||
// so we tell raw parser to check if there is a body
|
// so we tell raw parser to check if there is a body
|
||||||
const rawParserMiddleware = raw({ type: hasBody });
|
const rawParserMiddleware = raw({
|
||||||
|
type: hasBody,
|
||||||
|
limit: process.env.BODY_LIMIT ?? '50mb',
|
||||||
|
});
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class RawParserMiddleware implements NestMiddleware {
|
export class RawParserMiddleware implements NestMiddleware {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user