This project requires and external API to work. Otherwise it can be tested with the local dummy models in invitation-dummy.ts.
Provide API url by creating env file
PORT=3000
API_URL=https://something.com/api/
ENVIRONMENT=devNOTES:
API_URLis referring to the endpoint used to actually access/modify the storage data.ENVIRONMENTcan be filled withdevorprod.
Available API path:
- GET http://localhost:3000/wedding/invitations
- GET and POST http://localhost:3000/wedding/invitation/:id
- GET http://localhost:3000/wedding/invitation/pdf
- GET and POST http://localhost:3000/wedding/message/
- GET http://localhost:3000/wedding/message/size
- GET http://localhost:3000/wedding/message?page=:page&pageSize=:pageSize
- GET http://localhost:3000/wedding/message/range?offset=:offset&rangeSize=:rangeSize
I forked my production storage implementation in these public google sheets and appscript link for reference:
- Storage google sheets link (note: custom script to generate data id exist inside as well)
- Storage endpoint link
When using this endpoint, you need to deploy the script to be accessible and then use the endpoint URL as the API_URL, for example:
PORT=3000
API_URL="https://script.google.com/macros/s/AKfycbzLx_IdnCXupFaFxqOVN4-0wPk4J-LMEw5g6ROX0RlphEWQb0NcNWI4hQfApcW9gx0K6g/exec"
ENVIRONMENT=devNOTE: this is only a template from NodeJS project creation. To properly deploy this project in production, you need to follow the git submodule's parent docker command.
Following this setup enables for local testing.
Setup
npm installRun in production
npm startRun in dev
npm run devBuild / clean build
npm run build
# or
npm run build-clean