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=dev
NOTES:
API_URL
is referring to the endpoint used to actually access/modify the storage data.ENVIRONMENT
can be filled withdev
orprod
.
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=dev
NOTE: 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 install
Run in production
npm start
Run in dev
npm run dev
Build / clean build
npm run build
# or
npm run build-clean