Skip to content

Commit f57f35a

Browse files
env problems
1 parent b9ff84a commit f57f35a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

index.js

+8
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ app.use(publicRoutes);
3535
import apiRoutes from "./routes/api.js";
3636
app.use(apiRoutes);
3737

38+
// Verificar que las variables de entorno necesarias estén definidas
39+
const requiredEnvVars = ["formWebhookUrl", "logsWebhookUrl", "authUser", "authPass"];
40+
requiredEnvVars.forEach((varName) => {
41+
if (!process.env[varName]) {
42+
throw new Error(`La variable de entorno ${varName} no está definida o no tiene un valor.`);
43+
}
44+
});
45+
3846
// Iniciar el servidor
3947
app.listen(port, () => {
4048
console.log(`Servidor escuchando en http://localhost:${port}`);

0 commit comments

Comments
 (0)