import express, { Request, Response } from "express";
import * as http from "http";

export class WebServer {
    server: http.Server;
    constructor(props: { expressApp: Express.Application }) {
        this.server = this.createWebServer(props.expressApp);
    }
    public createWebServer(expressApp: Express.Application): http.Server {
        const server = http.createServer(expressApp);
        const port = process.env.PORT || 5005;
        server.listen(port, () => {
            console.log(`Server started on port ${port}`);
        });
        return server;
    }
}




