This is a Webmention receiver to be used as an endpoint to receive webmentions for your website.
It's still very much a work-in-progress and not ready for use, but I wanted to share progress as the spec evolves in the IndieWeb community.
- Node.js with Architect framework
- Deploy to AWS using Lambda, API Gateway, DynamoDB, SNS
- POST /webmention with
sourceandtargetform parameters- Return 400 if
sourceandtargetare not valid URLs - Return 400 if
sourceis the same as target - Return 400 if
targetis not a known domain (DOMAINSenv var) - Return 400 if
source's domain is found in blocked domain table - Generate a unique id for the webmention
- Store
id,source,targetand a timestamp in webmentions table - Log status "Received webmention"
- Publish verify event with
idpayload - Return 201 with
Locationheader/webmention/:id
- Return 400 if
- Handle verify event with
idpayload- Get the webmention record from the database
- Fetch the source, limiting to 1Mb, 20 redirects and a 5-second timeout
- Log error if
Content-Typeis not HTML, JSON or text - Log error if
sourcecontent does not includetarget - Publish parse event with
id
- Handle parse event with
idpayload- Get the webmention record from the database
- Send source URL to XRay to parse into JF2
- Log status "Source was parsed" or error if unsuccessful
- Upload author photo to Cloudinary
- Create a JF2 object (format TBD - see indieweb/webmention-ecosystem#2)
- Update webmention record with JF2 post in table
- Publish send event with
idpayload
- Handle send event with
idpayload- Get the webmention record from the database
- Send POST to config webhook URL with webmention record in JSON body
- GET /webmention with
targetquery parameter- Query for webmentions matching
target - Return 404 if no webmentions are found
- Return 200 with list of webmentions as HTML (default) or JSON depending on
Acceptheader
- Query for webmentions matching
- GET /webmention/:id
- Query for statuses matching
id - Return 404 if no statuses are found
- Return 200 with list of statuses as HTML (default) or JSON depending on
Acceptheader
- Query for statuses matching
ROOT_URLe.g. https://wembley.barryfrost.com/DOMAINSe.g. barryfrost.comWEBHOOK_URLe.g. https://api.barryfrost.com/webmention