Skip to content

Commit 41fedd1

Browse files
committed
Allow a custom host address to be set
1 parent 7a8e81f commit 41fedd1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-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.4.10",
3+
"version": "2.4.11",
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class FastifyServer implements Process {
1616
private server: Fastify.FastifyInstance = Fastify()
1717
private isAlive: boolean = false
1818

19-
constructor(public routes: RouterMap, private port: number = 8080) {
19+
constructor(public routes: RouterMap, private port: number = 8080, private host: string = "127.0.0.1") {
2020
for (let route of routes) {
2121
switch (route.method) {
2222
case "GET":
@@ -105,7 +105,7 @@ export class FastifyServer implements Process {
105105
this.server.use(m)
106106
}
107107

108-
await this.server.listen(this.port)
108+
await this.server.listen(this.port, this.host)
109109
this.isAlive = true
110110

111111
let loggerInstance = container.get(Logger)

0 commit comments

Comments
 (0)