Skip to content

Serverless jobs and services to handle search in Algorea >v2

License

Notifications You must be signed in to change notification settings

France-ioi/AlgoreaSearch

Repository files navigation

AlgoreaSearch

Installation

npm ci

Start

npm start

Test

npm test

Deploy code on AWS

sls deploy [-f <function name>] --stage <stage> --aws-profile <aws profile>

If you do global changes (for instance the role permissions), you need to deploy with specifying any function.

Use the headless browser locally

npx @puppeteer/browsers install chromium@latest --path /tmp/localChromium

Then, update CHROMIUM_PATH in .env.dev file.

Invoke scrapping locally

serverless invoke local --stage <stage> --function scrape-all

Invoke search locally

serverless invoke local --stage <stage> --function search -d '{"queryStringParameters":{"q":"Terminology"}}'

Deploy the headless browser on lambda

Use lambda layers as explained: https://github.com/sparticuz/chromium#aws-lambda-layer

Use layers published with their releases: https://github.com/Sparticuz/chromium/releases