This is a Serverless implementation of the AMPHTML validator.
It uses the official AMPHTML Validator and returns the validation results as a JSON response.
npm install -g serverless
serverless deploy
GET /validate
PARAMS:
- url = urlencoded path to an AMP HTML document
Valid AMP HTML:
{
"url": "https://www.ampproject.org",
"status": "PASS",
"errors": []
}
Invalid AMP HTML:
{
"url": "https://www.google.com",
"status": "FAIL",
"errors": [ ... ] // 64 items
}
Invalid URL:
{
"url": "https://i.am.not.a.website.xyz",
"status": "FAIL",
"errors": [
{
"severity": "ERROR",
"message": {
"name": "RequestError",
"message": "Error: getaddrinfo ENOTFOUND i.am.not.a.website.xyz",
"cause": {},
"error": {},
"options": {}
}
}
]
}
serverless remove -v
The MIT License (MIT)