omnivore/packages/puppeteer-parse
2022-05-18 15:52:16 +08:00
..
test Add tests 2022-05-09 11:11:13 -07:00
.env.example Add better getting started instructions for running puppeteer 2022-02-11 16:12:30 -08:00
.gcloudignore Open source omnivore 2022-02-11 09:24:33 -08:00
.gitignore Open source omnivore 2022-02-11 09:24:33 -08:00
apple-news-handler.js Fix tests cont 2022-05-12 17:53:28 +08:00
bloomberg-handler.js Fix tests cont 2022-05-12 17:53:28 +08:00
derstandard-handler.js Fix tests cont 2022-05-12 17:53:28 +08:00
Dockerfile Dockerize the puppeteer-parse service and add to docker-compose 2022-02-12 13:14:00 -08:00
image-handler.js Remove image text 2022-05-05 19:25:09 +08:00
index.js Fix content not getting parsed by linkedom properly without <html> tag by replacing innerHtml with outerHtml 2022-05-18 15:52:16 +08:00
medium-handler.js Merge pull request #597 from omnivore-app/remove-chrome-aws-lambda 2022-05-13 16:12:24 -07:00
package.json Use chrome-aws-lambda in the puppeteer GCF 2022-05-13 16:48:51 -07:00
pdf-handler.js Open source omnivore 2022-02-11 09:24:33 -08:00
README.md Open source omnivore 2022-02-11 09:24:33 -08:00
t-dot-co-handler.js Open source omnivore 2022-02-11 09:24:33 -08:00
twitter-handler.js Open source omnivore 2022-02-11 09:24:33 -08:00
youtube-handler.js Fix youtube handler 2022-05-18 11:28:33 +08:00

Puppeteer parsing function handler

This workspace is used to provide the GCF for the app to hande 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 functon 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")