Does anyone know of a framework that can help to structure and organize server responses from API endpoints (built on Netlify’s lambda functions, of course), that encodes current best practices, particularly around headers?
If I look at “node server” frameworks, they all want to run the server, which given the almighty Netlify, we don’t need. I’m envisioning helper functions that can help me deal in a methodical way with, say CORS, Authentication headers, Origin headers, Vary, OPTION methods, Set-Cookie, ETags, so on and so forth. I’m not above writing it myself, but I don’t want to reinvent that particular wheel, if someone has open-sourced their expertise on it
For anyone who finds this and thinks “that’s me too!”, I haven’t found anything specific yet, but I did find this: Functions examples - Netlify Functions It may be an obvious reference when you read this, but it is new to me now
I’m going through it and there is a wealth of ideas in there, including this validateHttpMethod which, as a simple method validator is a great model for creating other helpers.
Incidentally, if any moderators see this, I’d like to let you know that the link from the examples page lambda-jwt-auth “An auth service powered by lambda functions & MongoDB” points to a broken link. I did find lambda-jwt-auth-demo by searching GitHub, though.
I finally carved out some time to update this project and discovered that the repo is archived / read only. I’m happy to make that change, though. Let me know if the project becomes unarchived.
Not sure. There was a 1:1 mapping between the broken link and the other github project, but these seem to be updated and curated. Let’s “close” this for now, but revisit if there’s a need.