Skip to content

Commit 3f28ca7

Browse files
committed
Allow parameters to be passed directly to Fastify
1 parent c84b80a commit 3f28ca7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "strontium",
3-
"version": "2.9.3",
3+
"version": "2.9.4",
44
"description": "Strontium is a TypeScript toolkit for High Performance API servers built for Production not Projects.",
55
"main": "lib/src/index.js",
66
"types": "lib/src/index.d.ts",

src/http/drivers/FastifyServer.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { RouterMap } from "../abstract/RouterMap"
22
import { HTTPError } from "../../errors"
33
import { InvalidControllerError } from "../../errors"
44
import { InternalServerError } from "../../errors"
5+
import { ServerOptions } from "fastify"
56
import * as Fastify from "fastify"
67
import { Container } from "inversify"
78
import { Logger } from "../../logging"
@@ -13,13 +14,14 @@ import { isObject } from "../../validation"
1314
import { EndpointController } from ".."
1415

1516
export class FastifyServer implements Process {
16-
protected server: Fastify.FastifyInstance = Fastify()
17+
protected server: Fastify.FastifyInstance = Fastify(this.fastifyOptions)
1718
protected isAlive: boolean = false
1819

1920
constructor(
2021
public routes: RouterMap,
2122
private port: number = 8080,
22-
private host: string = "127.0.0.1"
23+
private host: string = "127.0.0.1",
24+
private fastifyOptions?: ServerOptions
2325
) {
2426
/*
2527
To handle limitations in Find My Way (Fastify's internal routing library)

0 commit comments

Comments
 (0)