The Node.js Back-End of Snapaper
- Node-Crawler
- Express
- Express-Generator
git clone [email protected]:Snapaper/snapaper-nodejs.gitMake sure Node.js has been installed before you continue. See Dockerfile for recommended Node.js environment version.
We use pnpm for development and yarn in production environment:
pnpm/yarn installBy default, the API service will be listening on port 8080. To change this behaviour, modify environment variable PORT.
pnpm/yarn run startWe use Redis to cache API responses. Currently, we use a remote Redis database service provided Upstash.
Build Docker image:
docker build --tag=snapaper-nodejs .Deploy with Fly.io:
fly launch
fly deployScale to 2 instances:
fly scale count 2