From d4e311165f10dddd978a3935dc02f5ca51b85d63 Mon Sep 17 00:00:00 2001 From: shallquist Date: Thu, 18 Feb 2021 10:38:07 -0500 Subject: [PATCH] Fix error for console log in app.listen call back. Need to cast the return from httpServer.address() as AddressInfo to allow logging of port. --- server/server.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/server.ts b/server/server.ts index 435c659..f2fb5b8 100755 --- a/server/server.ts +++ b/server/server.ts @@ -1,6 +1,7 @@ import * as express from 'express'; import {Application} from "express"; +import {AddressInfo} from "net"; import {readAllLessons} from "./read-all-lessons.route"; import {addPushSubscriber} from "./add-push-subscriber.route"; import {sendNewsletter} from "./send-newsletter.route"; @@ -43,7 +44,8 @@ app.route('/api/newsletter') // launch an HTTP Server const httpServer = app.listen(9000, () => { - console.log("HTTP Server running at http://localhost:" + httpServer.address().port); + const address = httpServer.address() as AddressInfo; + console.log("HTTP Server running at http://localhost:" + address.port); });