import dotenv from "dotenv";

dotenv.config();

import { connectMongo } from "./config/mongodb";
//import { connectSqlServer } from "./config/sqlserver";
import app from "./app";

const PORT = process.env.PORT || 5000;

const startServer = async() => {

    try {

        await connectMongo();
        //await connectSqlServer();


    app.listen(PORT, () => {

        console.log(`Servidor ejecutandose en puerto ${PORT}`);
    });
    
    }catch(error){

        console.error("Error al iniciar el servidor", error);
    }

};

startServer();