I’m looking for a way to make an external call when a user clicks a link. It would be a POST request to an API but i don’t want the request to come from the user, it would need to be server side. I’m assuming that the way hugo works by creating a static site this might be a challenge. I don’t want the POST to the API to pass through the user for security reasons(API Auth Info).
Has anyone every come across this and how did they solve it?
That’s not possible. Static website and such. There is nothing happening server side other than sending the (pre-produced and finished) pages and assets to the users browser. Either have that call on the user side if the request is based on interaction of the user with the website or while building the site if the request is based on content or timing of it.
Thanks @davidsneighbour I figured as much. I’m thinking I’ll have a webhook link that gets called which handles the API call when passed the value it needs.
I was considering trying a static php page but github pages doesnt support any server side code. So I’m limited by both Hugo and gh-pages so it does look like a webhook is the only option.
I know you said you’re on GitHub pages, but netlify has such features available with their functions