From d6b5393fe49f595d4c738c392bac2f9a5fdc42b2 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Wed, 25 Mar 2020 08:57:46 +0100 Subject: [PATCH] Can get remote IP address --- src/entities/RequestHandler.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/entities/RequestHandler.ts b/src/entities/RequestHandler.ts index e9d3af2..de32c03 100644 --- a/src/entities/RequestHandler.ts +++ b/src/entities/RequestHandler.ts @@ -31,6 +31,14 @@ export class RequestHandler { public constructor(private req : Request, private response : Response) {} + /** + * Get remote IP address + */ + public get remoteIP() : string { + // TODO : check in production + return this.req.ip; + } + /** * Get a parameter included in the post request *