Ask HN: How can I design a generic library that provides its own endpoints?
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.
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.
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
Is this solved elegantly on any other language or framework?
0 comments
[ 3.2 ms ] story [ 10.2 ms ] threadNo comments yet.