Serverless API with Claudia.js in 3 Steps

Milos Bejda
Oct 21, 2017 · 2 min read

Claudia.js is a open source command line tool that makes rolling out serverless API’s on AWS easy. It uses your code as a blueprint to create an API layer on AWS API Gateway and prepares an AWS Lambda to handle the API requests. It then connects the API layer with the Lambda. The thing that makes this tool so great is that you don’t have to know the inner workings of AWS to start using it. Its so easy to use, you can get started with Claudia.js in just a few steps.

1) Install Claudia.js

If you don’t have Claudia.js installed on your machine, open up your terminal and run the following command to install it:

npm install -g claudia

That command will install Claudia.js globally so you can use it in any directory.

2) Create index file with API methods

In the root of your project directory create an index.js file and install claudia-api-builder.

npm install claudia-api-builder --save

Add the following Claudia.js template code :

var ApiBuilder = require('claudia-api-builder').
api = new ApiBuilder();
module.exports = api; api.get('/github', function (request) {return request.queryString;});

That code tells Claudia.js to create a [GET] API endpoint and tells Lambda to return its query string.

3) Deploy API

To deploy your API, open your terminal and execute the following command:

claudia create --region us-east-1 --api-module index

You should see some log information generated by that command. Claudia.js is creating and configuring AWS services and policies needed for the API to function. Once the deployment process is complete, take note of the URL in the JSON response that looks similar to the following:

Copy that URL and format it to include your API call and a query string and navigate to it in your browser window.

You should have received a response similar to this :

Have fun building API’s!

Milos Bejda

Written by

AWS Devops Guy (

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade