NanoAPI Docs
Intro to Nano APIWhat it DoesWhy Use Nano API?What Are Some Use-Cases?What's Next? How Do I Get Setup?Getting Started
Tutorials
Security
Supported Technologies

What is Nano API?

Nano API is a novel SaaS tool used for converting a backend web API from a single service to a swarm of serverless cloud functions.

What it Does

Still confused? We don't blame you. Let's say that you have the following NodeJS Express server:

// ./src/math.service.js
export function addition(a, b) {
return a + b;
}
export function subtraction(a, b) {
return a - b;
}
// ./src/api.js
import * as express from 'express';
import * as service from './service.js';
const app = express();
const port = 3000;
const urlBase = '/api/v2/maths';
app.use(express.json());
app.get(urlBase + '/addition', (req, res) => {
const { body } = req;
const result = service.addition(body.a, body.b);
return res.json({
result
});
});
app.get(urlBase + '/subtraction', (req, res) => {
const { body } = req;
const result = service.subtraction(body.a, body.b);
return res.json({
result
});
});
app.listen(port, () => {
console.log(`App listening on port: ${port}`);
});

If you were to take the above code and run it, you would get a webserver that provides two endpoints: /addition and /subtraction.

This is where Nano API's build functionality comes in.

Running the above code through our tool will result in 2 serverless-function-compatible files containing everything needed to deploy this functionality to a function of your choice (AWS, Azure, GCP).

Not only does the tool perform the transpilation for the backend code, it will also deploy the functions for you! In the case of AWS-hosted functions, Nano API will configure your API Gateway and create all the resources needed to deploy the above files. (Support for Azure and GCP is on the way!)

Why Use Nano API?

The answer is twofold: performance and sustainability. Cloud functions use less energy than a normal horizontally-scaled webserver on an EC2 or other similar environment. Both cold and warm start times for functions are insanely fast. Check out this helpful benchmarking repo to see the actual times.

What Are Some Use-Cases?

We've thought a lot about the current state of serverless computing, and we've recognized that there is a lack of a real road to adoption for existing projects, alongside some other issues serverless brings. If you've ever come across any of the following cases, Nano API is the tool for you:

Aggregate Simple Services

Many companies nowadays have integrations with service providers like Slack, GitHub, Gitlab, and others. Often, these tools are written as one-off codebases that get stuck in a corner somewhere and lose developer focus.

With Nano API you could bundle these integrations together as a single Web Framework codebase, and deploy them separately.

Hire Devs with Industry-Standard Knowledge

As in the above case, having lambda (or other serverless functions) in one codebase simplifies maintenance for all of your separate functions. As an added benefit, this means you can hire developers with industry-standard knowledge in a given Web Framework, and use that framework to write and support your infrastructure. No more need to find AWS specialists or hire contractors to setup your AWS account and functions.

Break Apart Expensive Monoliths

Anyone involved in hosting a large NodeJS, Python, or other runtime-language backend application knows that, as the codebase grows in size and complexity, so too does the cost of running enough instances to meet customer needs.

For instance, in both NodeJS and Python applications, they actually suffer a decrease in performance as the codebase size increases. This is why tree-shaking is so important for these languages, and why Nano API gives it to you out of the box!

What's Next? How Do I Get Setup?