2025-02-01 21:48:13 +00:00
|
|
|
import { createApp } from "./app";
|
2025-01-29 16:01:17 +00:00
|
|
|
import { connectToDatabase } from "./config/database";
|
2025-01-28 14:01:02 +00:00
|
|
|
|
2025-01-29 16:01:17 +00:00
|
|
|
const PORT = process.env.PORT || 3000;
|
2025-01-28 14:01:02 +00:00
|
|
|
|
2025-01-29 16:01:17 +00:00
|
|
|
(async () => {
|
|
|
|
|
// Conexión a la base de datos
|
|
|
|
|
await connectToDatabase();
|
2025-01-28 14:01:02 +00:00
|
|
|
|
2025-01-29 16:01:17 +00:00
|
|
|
// Inicializar la aplicación
|
|
|
|
|
const app = createApp();
|
|
|
|
|
|
|
|
|
|
app.listen(PORT, () => {
|
|
|
|
|
console.log(`Servidor escuchando en http://localhost:${PORT}`);
|
|
|
|
|
});
|
|
|
|
|
})();
|