This document provides instructions on how to use the Docker environment for our project and outlines the functionality of our API endpoints.
To configure the Docker environment, update your docker-compose.yml
file as follows:
version: "3"
services:
app:
build: .
ports:
- "3000:3000"
environment:
- SMTP_SERVICE=SMTP
- [email protected]
- SMTP_PASS=pass
- SMTP_HOST=host
- SMTP_PORT=465
To initialize the Docker environment, run the following command:
docker-compose up -d
To update your Docker container, run the following command:
docker-compose up -d --build
To test the PDF generation feature, access the form at:
URL: http://localhost:3000/form.html
URL: http://localhost:3000/submit-letter
Method: POST
Body Format:
{
"email": "string",
"name": "string",
"letterText": "string",
"momentGift": "string",
"signature": "string"
}
Response: A PDF file containing the submitted letter.
URL: http://localhost:3000/send-email
Method: POST
Body Format:
{
"email": "string",
"name": "string",
"letterText": "string",
"momentGift": "string",
"signature": "string"
}
Description: Sends an email with the provided content using the settings defined in the .env file.