You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for writing this up :) I copied your approach, but made a change to retrieve the /.well-known/webfinger data from my Mastodon instance directly. Inside the Edge Function I fetch it, then return a modified version of that response. That way, any changes that Hachyderm makes will be reflected in my endpoint, and the headers like content-type: application/jrd+json; charset=utf-8 are retained:
import{Status}from'https://deno.land/[email protected]/http/http_status.ts';exportdefaultasync(request,context)=>{consturl=newURL(request.url);constresourceParam=url.searchParams.get('resource');if(resourceParam===null){returncontext.json({error: "No 'resource' query parameter was provided",},{status: Status.BadRequest,});}if(resourceParam!=='acct:[email protected]'){returncontext.json({error: 'An invalid identity was requested',},{status: Status.BadRequest,});}constwebfingerResponse=awaitfetch('https://hachyderm.io/.well-known/webfinger?resource=acct:[email protected]');constjson=awaitwebfingerResponse.json();json.links.push({rel: 'http://webfinger.net/rel/profile-page',type: 'text/html',href: 'https://wolstenhol.me',});returnnewResponse(JSON.stringify(json),webfingerResponse);};
Mastodon on your own domain without hosting a server, Netlify edition | Harsh Shandilya
A quick and easy way of creating a Fediverse identity on your own domain without an ActivityPub server
https://msfjarvis.dev/posts/mastodon-on-your-own-domain-without-hosting-a-server-netlify-edition/
The text was updated successfully, but these errors were encountered: