Claudia 1.2 - some updates that made me want to write a post

Posted by Marcus Hammarberg on April 23, 2016

Claudia 1.2 - some updates that made me want to write a post

I downloaded a new markdown editor called Typora that looks amazing. Now I just wanted to try it out, and needed something to write about.
Also I’ve noticed that Claudia has come out with some new releases and that AWS Lamdba now supports Node 4.3.2 - which is awesome.
This post gave an opportunity to fix both itches above in one go. So this is an updated “Get started with Claudia JS for AWS Lambda”-post.

The first script is the one actually creating our little site in the AWS Lambda world; setting API gateways, configuring roles and all of that, which we want to forget - is the reason we’re using Claudia in the first place.

Notice that we don’t give our lambda function a name. That is picked up from the package.json and the name property. As long you’re happy with that name you don’t need to supply a --name flag to claudia create. You still can should you want to override the name, of course.

Let’s run it now: npm run create and a few seconds later you’ll see a nice little output stating that you have a new application in AWS. Here’s the output, let’s look a little closer:

It tells us what the role is called, the name of our function and the region we deployed it in. Also we get some very useful information about the API Gateway that Claudia has created for us. This is needed for us to actually be able to invoke the function over the internet.

Checkout that last part in the end; there’s a URL there. Paste it into a browser and wah-wah-wah, you forgot to add the /hello/Marcus part to the URL, like me - didn’t you? Because that URL in the output is just the URL to the root of our API.