4 ms·
We use Lambda for our contact form; it's great. Our website is completely hosted on s3/cloudfront so it's much cheaper and stable than running a dedicated machi
by cowholio4 10y ago
We use Lambda for our contact form; it's great. Our website is completely hosted on s3/cloudfront so it's much cheaper and stable than running a dedicated machine.
If I get some time this weekend, I'll clean it and push it up to github.
[EDIT]
Here it is. This has been working for us for almost a year. If there is interest, I can clean it up.
https://github.com/cowholio4/lambda-contact-form https://github.com/cowholio4/lambda-contact-form
- wallacoloo 10y agoOh, this is great - thanks! I've been considering adding comments to my static website for a while. I already deploy the website over IPFS, so that [in theory] the entire website can be distributed, and it can be duplicated/cached, etc when I have a spotty internet connection. Ideally, I would also have the comments published directly on IPFS as well, rather than having the comments be retrieved from somewhere external to the IPFS network. Your code should let me deal with that - just have the comment system fire off an email to me when a user posts a comment, and a daemon running on my PC can publish the comment next time it's online. Plus, I get easy email notifications :) Such an approach seems a bit convoluted though. I'm not used to web programming, wherein it seems like every popular approach to hosting something as simple as a blog comes with pretty significant drawbacks or limitations. I'm much more fond of working in environments which offer an objectively "right" way to do every task.
- appleflaxen 10y agoHow does it work? You POST to the lambda service, and it emails the url parameters with the specified formatting? This requires a separate HTML form to be served from your website first, right? Very cool idea! Thanks for sharing it :)
- cowholio4 10y agoYeah, I didn't really make that part clear. You have to create an API Gateway. Luckily, AWS lets you share API definitions so I added that to the repo. It's the swagger.json file. I'll try to get this all automated to make it super simple, but for now you just have to replace all those placeholders.