Skip to content

Snapaper/snapaper-nodejs

Repository files navigation

Snapaper Node.js

The Node.js Back-End of Snapaper


Dependencies

  • Node-Crawler
  • Express
  • Express-Generator

Development

git clone [email protected]: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

Deployment

Redis

We use Redis to cache API responses. Currently, we use a remote Redis database service provided Upstash.


Docker image

Build Docker image:

docker build --tag=snapaper-nodejs .

Deploy to Fly

Deploy with Fly.io:

fly launch
fly deploy

Scale to 2 instances:

fly scale count 2