Skip to content

Commit

Permalink
feat: increment max body limit by optional env
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Cruz committed Apr 8, 2021
1 parent 69d1591 commit 225c6e6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cardano-rosetta-server/README.md
Expand Up @@ -37,6 +37,8 @@ CARDANO_NODE_SOCKET_PATH=/tmp/node.socket
PAGE_SIZE=25
# relative ttl to be used if any is sent during the request
DEFAULT_RELATIVE_TTL=1000
# request payload limit
BODY_LIMIT=1048576
```

### Install packages from offline cache
Expand Down
2 changes: 1 addition & 1 deletion cardano-rosetta-server/src/server/server.ts
Expand Up @@ -29,7 +29,7 @@ const buildServer = (
logLevel: string,
extraParameters: ExtraParams
): fastify.FastifyInstance<Server, IncomingMessage, ServerResponse> => {
const server = fastify({ logger: { level: logLevel } });
const server = fastify({ logger: { level: logLevel }, bodyLimit: process.env.BODY_LIMIT });
const { networkId, pageSize } = extraParameters;
server.register(fastifyBlipp);
server.register(openapiGlue, {
Expand Down
2 changes: 2 additions & 0 deletions cardano-rosetta-server/src/types/app.d.ts
Expand Up @@ -10,5 +10,7 @@ declare namespace NodeJS {
DEFAULT_RELATIVE_TTL: number;
CARDANO_NODE_PATH: string;
TOPOLOGY_FILE_PATH: string;
TOPOLOGY_FILE_PATH: string;
BODY_LIMIT: number;
}
}

0 comments on commit 225c6e6

Please sign in to comment.