|
2 | 2 | </p> |
3 | 3 |
|
4 | 4 | > [!TIP] <p align="justify"> |
5 | | -> **Service Status:** The API is optimized for Render's free tier, automatically managing cold starts and network constraints through a robust transport configuration. <br/> <p align="center"> |
| 5 | +> To prevent `Connection Timeout` errors on Render's free tier, port **2525** must be used instead of 587. Additionally, the server should be executed with the `--dns-result-order=ipv4first` flag to ensure DNS resolution compatibility with email services. This project uses Brevo for email delivery. <br/> <p align="center"> |
6 | 6 | [](https://github.com/Clic-stack/Auth-Mailer-API/actions/workflows/ci.yml) |
7 | 7 | [](https://github.com/Clic-stack/Auth-Mailer-API/actions/workflows/codeql.yml) |
8 | 8 | [](https://github.com/Clic-stack/Auth-Mailer-API/actions/workflows/dast.yml) |
@@ -263,9 +263,9 @@ The following endpoints are tested: |
263 | 263 | ## 📄 Scripts (package.json) |
264 | 264 | ```bash |
265 | 265 | "scripts": { |
266 | | - "dev": "node --watch --env-file=.env src/server.js", |
267 | | - "start": "node src/server.js", |
268 | | - "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --detectOpenHandles --forceExit" |
| 266 | + "dev": "node --watch --dns-result-order=ipv4first --env-file=.env src/server.js", |
| 267 | + "start": "node --dns-result-order=ipv4first src/server.js", |
| 268 | + "test": "node --dns-result-order=ipv4first --experimental-vm-modules -r dotenv/config node_modules/jest/bin/jest.js --no-cache --detectOpenHandles --forceExit" |
269 | 269 | } |
270 | 270 | ``` |
271 | 271 |
|
@@ -412,10 +412,12 @@ npm install |
412 | 412 | NODE_ENV=development |
413 | 413 | PORT=4000 |
414 | 414 | DATABASE_URL=postgres://user:password@localhost:5432/emails_db |
415 | | -EMAIL= |
416 | | -GOOGLE_APP_PASSWORD= |
| 415 | +EMAIL=Brevo SMTP User ID |
| 416 | +GOOGLE_APP_PASSWORD=Brevo SMTP Master Password |
417 | 417 | SECRET_KEY= |
418 | 418 | EXPIRE_IN=1d |
| 419 | +SMTP_HOST=smtp-relay.brevo.com |
| 420 | +SMTP_PORT=Use 2525 for Render |
419 | 421 | ``` |
420 | 422 |
|
421 | 423 | 5. Run the server in development mode: |
@@ -462,7 +464,7 @@ Developed by **Clio Salgado** as part of the Node.js & Backend module, with the |
462 | 464 | </p> |
463 | 465 |
|
464 | 466 | > [!TIP] <p align="justify"> |
465 | | -> **Estado del Servicio:** La API se encuentra optimizada para el plan gratuito de Render, gestionando automáticamente el cold start y las limitaciones de red mediante una configuración de transporte robusta.<br/> <p align="center"> |
| 467 | +> Para evitar errores de `Connection Timeout` en el plan gratuito de Render, se debe utilizar el puerto **2525** en lugar del 587. Además, es necesario ejecutar el servidor con el flag `--dns-result-order=ipv4first` para asegurar una resolución de DNS compatible con los servicios de correo. Este proyecto usa Brevo para el envío de correos.<br/> <p align="center"> |
466 | 468 | [](https://github.com/Clic-stack/Auth-Mailer-API/actions/workflows/ci.yml) |
467 | 469 | [](https://github.com/Clic-stack/Auth-Mailer-API/actions/workflows/codeql.yml) |
468 | 470 | [](https://github.com/Clic-stack/Auth-Mailer-API/actions/workflows/dast.yml) |
@@ -719,9 +721,9 @@ Los siguientes endpoints fueron testeados |
719 | 721 | ## 📄 Scripts (package.json) |
720 | 722 | ```bash |
721 | 723 | "scripts": { |
722 | | - "dev": "node --watch --env-file=.env src/server.js", |
723 | | - "start": "node src/server.js", |
724 | | - "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --detectOpenHandles --forceExit" |
| 724 | + "dev": "node --watch --dns-result-order=ipv4first --env-file=.env src/server.js", |
| 725 | + "start": "node --dns-result-order=ipv4first src/server.js", |
| 726 | + "test": "node --dns-result-order=ipv4first --experimental-vm-modules -r dotenv/config node_modules/jest/bin/jest.js --no-cache --detectOpenHandles --forceExit" |
725 | 727 | } |
726 | 728 | ``` |
727 | 729 |
|
@@ -869,10 +871,12 @@ npm install |
869 | 871 | NODE_ENV=development |
870 | 872 | PORT=4000 |
871 | 873 | DATABASE_URL=postgres://user:password@localhost:5432/emails_db |
872 | | -EMAIL= |
873 | | -GOOGLE_APP_PASSWORD= |
| 874 | +EMAIL=Brevo SMTP User ID |
| 875 | +GOOGLE_APP_PASSWORD=Brevo SMTP Master Password |
874 | 876 | SECRET_KEY= |
875 | 877 | EXPIRE_IN=1d |
| 878 | +SMTP_HOST=smtp-relay.brevo.com |
| 879 | +SMTP_PORT=Use 2525 for Render |
876 | 880 | ``` |
877 | 881 |
|
878 | 882 | 5. Corre el servidor en modo desarrollo: |
|
0 commit comments