TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: How can I design a generic library that provides its own endpoints?

1 pointsby WesSouzaover 2 years ago
I like how ActivityPub can be implemented on any website and provide a good set of endpoints to enable rich, social-media-like content interactions. I&#x27;d love to enable my current website to respond to those requests, but I don&#x27;t want to either use &quot;activitypub-express&quot; or install a full Mastodon (or any other) server just for myself.<p>My idea was to implement the protocol myself, which would be a nice way to learn it and its problems. But I would also love to make it a library that can be applied by others on their own, already existing websites.<p>The problem that I am having is that the current methods to implement this kind of pluggable extension involve connecting to one specific back end framework, such as creating an Express middleware.<p>What I was thinking was: - Use TypeScript (to leverage the large JS community) - Make it as vanilla as possible - Use fetch standards such as the Request and Response objects, which are available natively since Node 18 - Provide multiple adapters for common frameworks such as Express, Fastify, Next.js, Astro, etc<p>Is this solved elegantly on any other language or framework?

no comments

no comments