import cors from 'cors' ; import express from 'express' ; import { logger } from '../utils/logger' ; export class ServerSingleton { private static instance : ServerSingleton ; private server : express ; private constructor ( ) { this . server = express ( ) ; } start ( port ) { this . server . listen ( port ) ; this . server . use ( cors ( ) ) ; logger . info ( `server handler started on ${ port }  🚀` ) ; } public getServer ( ) { return this . server ; } public static getInstance ( ) { if ( ! ServerSingleton . instance ) { ServerSingleton . instance = new ServerSingleton ( ) ; } return ServerSingleton . instance ; } }