The Node.js Back-End of Snapaper
- Node-Crawler
- Express
- Express-Generator
git clone git@github.com:Snapaper/snapaper-nodejs.git
Make 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 install
By default, the API service will be listening on port 8080. To change this behaviour, modify environment variable PORT
.
pnpm/yarn run start
We 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 deploy
Scale to 2 instances:
fly scale count 2