News for hackers. Stuff that matters.
Re:Use AWS Lambda to self-host the comments for your blog by cowholio4 on Friday May 06, 2016 @04:23PM (#11646487)
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

Re:Use AWS Lambda to self-host the comments for your blog by wallacoloo on Saturday May 07, 2016 @02:51AM (#11648672)
Oh, 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.

Re:Use AWS Lambda to self-host the comments for your blog by appleflaxen on Saturday May 07, 2016 @08:52AM (#11649388)
How 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 :)

Re:Use AWS Lambda to self-host the comments for your blog by cowholio4 on Saturday May 07, 2016 @05:49PM (#11651490)
Yeah, 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.