This is a simple IndieAuth middleware that can be used in conjunction with Express.js or any other framework that uses a similar API.
$ npm i --save @hacdias/indieauth-middleware
This example uses express.js as the middleware framework but you can use anything as long as you provide an object with the JSON or the form encoded data.
const indieauth =const express =const app =appapp
MIT © Henrique Dias