Skip to content

GraphQL API that allows to convert web pages to PDF, PNG, JPEG or WEBP format

License

Notifications You must be signed in to change notification settings

michalszc/PageRenderAPI

Repository files navigation

PageRenderAPI

Apollo-GraphQLAWSExpress.jsTypeScriptESLintJest.ENVDocker

This Node.js project provides a GraphQL API that allows users to convert web pages to PDF, PNG, JPEG or WEBP format by passing the URL of the target web page.

Installation

Clone the repo and install dependencies:

git clone https://github.com/michalszc/PageRenderAPI.git
cd PageRenderAPI
npm install

Set environment variables (.env):

PGUSER=user
PGPASSWORD=password
PGHOST=127.0.0.1
PGPORT=5432
PGDATABASE=render
AWS_BUCKET=bucket
AWS_REGION=eu-central-1
AWS_ACCESS_KEY=access
AWS_SECRET_KEY=secret
AWS_S3_ENDPOINT=http://127.0.0.1:4566 # if using Localstack

Running in Development

# Build and run project
npm run start

# Build the project, run it and watch for changes
npm run watch

Lint

# lint code with ESLint
npm run lint

# try to fix ESLint errors
npm run lint:fix

Test

# run all tests with jest
npm run test

# run all tests and report coverage information
npm run test:coverage

Validate

# run lint and tests
npm run validate

Docker

# run container in development (run only services - postgres and s3 on localstack)
npm run docker:dev

# run container (services + this application)
npm run docker:start

License

Licence