How to add serverless functions? #570
Unanswered
rubenrivera
asked this question in
Q&A
Replies: 1 comment
-
UpdateI added some files from https://github.com/11ty/demo-eleventy-serverless-oauth to a newly created digital garden from the Obisidian Digital Garden repository and modified some files to add Stack Overflow as an OAuth provider. The login and retrieval of the logged-in user information is working. Still, I had to find a way to make this work without changing the files that a future update of the Obsidian Digital Garden might overwrite, i.e. , Related
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm new to Eleventy, so I would like to know if adding serverless function support is possible by only editing
src/helpers/userSetup.js
andsrc/helpers/userUtils.js
.I'm looking for options to add authentication to digital gardens. I found a demo about using OAuth on Eleventy that showcases the Eleventy Serverless plug-in, so it looks plausible. After some days, I found a way, but it required me to edit files other than the ones mentioned above:
I edited the notes.11tydata.js file to make the permalink property an object, as the Eleventy Serverless plugin requires. This was enough to run the site locally using
netlify-cli
. Still, when pushing the changes to GitHub, the command favicon onsrc/site/_includes/components/pageheader.njk
was causing problems. I added a condition to skip this command when the serverless function generated the page.Is it possible to make the permalink property an object for a few notes, let's say having the "private" tag, by customizing only
src/helpers/userSetup.js
andsrc/helpers/userUtils.js
References
Beta Was this translation helpful? Give feedback.
All reactions