Webmention is an open web standard (W3C Recommendation) for conversations and interactions across the web, a powerful building block used for a growing distributed network of peer-to-peer comments, likes, reposts, and other responses across the web.
Implementation of a Webmention receiver built in Typescript. This project uses the serverless framework for Deployment to AWS & uses two DynamoDB tables for storing data. By using these services we can deploy an extremely fast & extremely cheap webmention receiver that can be easily deployed & integrated into existing sites.
pnpm install
PROFILE="aws-profile-name" REGION="ap-southeast-2" pnpm run startYou may have to restart serverless and rerun pnpm run start after making changes.
Ensure you have awscli installed on your system & have configured a profile.
Deploy to development environment
pnpm install
PROFILE="aws-profile-name" REGION="ap-southeast-2" pnpm run deploy:devDeploy to production environment
pnpm install
PROFILE="aws-profile-name" REGION="ap-southeast-2" pnpm run deploy:dev/web-mentions(POST): Submit a Webmention/web-mentions/status/:id(GET): Get status of submitted Webmention/web-mentions/query(POST): Query all Webmentions based on target param
When making a request to the webmention endpoint the service will return 201 if the base of your request is ok, this response will include a location header which contains a path to view the status of your request.
The server will then fetch the source and target and confirm that both exist and the source mentions the target. If this is successful the status object will update to have the status of SUCCESS and a mention object will be inserted into the database.
The following errors codes exist in the system:
STATUS_GONE: You requested a status object that does not exist or has been removed from the DBINVALID_INPUT: You are missing eithersourceortargetin your initial requestSAME_URL: Bothsourceandtargetare the sameFETCH_FAILED: Eithersourceortargetdid not response200 OKNO_MENTION: The providedSourcedoes not mention thetargetMISSING_TARGET: You requested a list of mentions for a target without including atargetUNKOWN: This will come alongside a500response from the server, there has been an error in the handler itself