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

Fetch Licenses

A service that makes license files readable using headless Chrome.

Setup

  • This project uses TypeScript and Node.
  • Download nvm and run nvm install to install a suitable version of Node.
  • Install yarn using npm install -g yarn.
  • Run yarn 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 yarn 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 yarn setupGcpProject to setup credentials.
  • Run yarn deploy to deploy the project to App Engine.