omnivore/packages/content-fetch
2024-04-04 12:17:15 +08:00
..
src fix: save url operation is delayed 2024-02-21 17:54:08 +08:00
test fix tests 2024-04-04 12:17:15 +08:00
.dockerignore convert content-fetch to typescript 2024-01-18 18:48:46 +08:00
.env.example Update env example 2022-11-16 10:15:49 +08:00
.eslintignore convert content-fetch to typescript 2024-01-18 18:48:46 +08:00
.eslintrc create batch save page jobs after fetching content 2024-01-18 18:48:46 +08:00
.gitignore Ignore app.yaml 2022-05-09 13:54:02 +08:00
Dockerfile Label the content-fetch and web images 2024-02-21 14:16:21 +08:00
Dockerfile-gcf fix: build content-fetch in dockerfile 2024-01-19 10:13:05 +08:00
mocha-config.json fix tests 2024-04-04 12:17:15 +08:00
package.json add save page job processor 2024-01-18 18:48:46 +08:00
README.md docs: fix typos in packages/content-fetch/README.md 2023-10-18 20:35:35 +05:45
tsconfig.json convert content-fetch to typescript 2024-01-18 18:48:46 +08:00

Puppeteer parsing function handler

This workspace is used to provide the GCF for the app to handle requests for the article parsing via Puppeteer.

Using locally

Copy .env.example file to .env file: cp .env.example .env

Run yarn start to start the Google Cloud Function locally (Works without hot reloading).

After this, you should be able to access the function on http://localhost:8080/puppeteer

Deployment

To deploy the function use the following command:

gcloud functions deploy puppeteer --runtime nodejs12 --trigger-http --memory 1GB --set-env-vars REST_BACKEND_ENDPOINT=<backend-address>,JWT_SECRET=<jwt-secret>

where:

<backend-address> - address of the backend server (e.g "http://localhost:4000")

<jwt-secret> - JWT secret that the backend server is using (e.g "some_secret")