tree: f446574f87e9ad9abbb12c24d88a95351d0ce60b [path history] [tgz]
  1. .vscode/
  2. .gcloudignore
  3. .gitignore
  4. .nvmrc
  5. .puppeteerrc.cjs
  6. app.yaml
  7. flags.ts
  8. index.ts
  9. license.ts
  10. logger.ts
  11. package-lock.json
  12. package.json
  13. plain_text_formatter.ts
  14. README.md
  15. tsconfig.json
  16. types.ts
  17. url-transforms.ts
development/fetchLicenses/README.md

Fetch Licenses

A service that makes license files readable using headless Chrome.

Setup

  • This project uses TypeScript and Node.
  • Download fnm and run fnm install to install a suitable version of Node.
  • Run npm install to setup dependencies.
  • Use Visual Studio code to debug and test.

Testing

Local debugging

Run the web service locally using the provided package scripts. Run npm run-script debug and this spins up a local web server. You can use Visual Studio code to attach to this process. nodemon and tsc --watch compiles and restarts your service as you are making changes to the source code automatically in debug mode.

Example HTTP Request

curl -d '{"url": "https://opensource.org/licenses/bsd-license.php"}' -H 'Content-Type: application/json' -X POST 'http://localhost:8080/convert/licenses'

Deploy

  • Install the gcloud CLI.
  • Run npm run-script setupGcpProject to setup credentials.
  • Run npm run-script deploy to deploy the project to App Engine.

Notes

Using Puppeteer v18.2.1 only because npm post install scripts for Puppeteer 19.x.x have been broken for App Engine standard. More context is here.