Metlo supports writing custom templates using Typescript. You can write and test
your templates locally and push them to Metlo using the CLI
(Setup Instructions).
The first step is to setup a node project to build your templates in. Be sure to
have both Node and NPM installed before following these steps! We highly
recommend using nvm.
Although you can structure your templates however you want, since templates can
have different versions we recommend structuring your template repository like
this (with folders for templates and typescript files for each version):
First create a folder called templates in your project:
Copy
mkdir templates
After that create a folder inside it for your template, lets make a template
that verifies if an endpoint always responds with CSP Headers called
VERIFY_CSP_HEADERS.
Copy
cd templatesmkdir VERIFY_CSP_HEADERScd VERIFY_CSP_HEADERStouch v1.ts
Now you can open v1.ts in the editor of your choice and paste the following: