The easiest way to build and ship your node.js app online… for FREE

Yvo Wu
2 min readJul 5, 2023

--

As a frontend engineer, recently I tried out a new Node.js cloud service called aircode.io.

This service allows for quick and easy creation of Node.js cloud functions online, enabling convenient debugging and one-click deployment to the cloud.

You can directly create an app by its initialization guide:

After initialization, the project will provide a default file named hello.js, which is a single cloud function named “hello” with the following code:

// @see https://docs.aircode.io/guide/functions/
const aircode = require('aircode');

module.exports = async function (params, context) {
console.log('Received params:', params);
return {
message: 'Hi, AirCode.',
};
};

In AirCode, you can simply create a JS, MJS, or TS file and export an asynchronous function, which will automatically become an entry point for a cloud function. This follows a modern and popular FaaS (Function-as-a-Service) architecture that is simple and convenient.

AirCode also comes with built-in integration for a distributed document database and file storage, making it incredibly convenient to meet our needs. Furthermore, their APIs are straightforward and easy to grasp by referring to the documentation.

Apart from using aircode to implement Node.js services, we can even utilize it to render HTML pages. For instance, for the simplest scenario, you only need to set the content-type response header to text/html and return the HTML text:

// @see https://docs.aircode.io/guide/functions/
const aircode = require('aircode');

module.exports = async function (params, context) {
console.log('Received params:', params);
context.set('content-type', 'text/html');
return `<h1>Hello</h1>`;
};

There is also an open-source project called aircode-app that can help you develop web apps in a similar way as koa.js.

// @see https://github.com/akira-cn/aircode-app
const App = require('aircode-app');

const app = new App();

app.use(async (ctx, next) => {
await next();
console.log('foobar');
});

app.use(async (ctx, next) => {
const {params} = ctx;
ctx.set('content-type', 'text/html');
ctx.body = app.display('./hello.html', {params});
});

module.exports = app.run();

Using AirCode, I developed a very simple todo list application, and I’d like to share its code with you: https://aircode.cool/d3iaymiwmt (Sharing is also one of AirCode’s major features).

Currently, you can use AirCode for FREE to create projects, deploy your applications, or choose to pay for its premium features. I hope you enjoy this platform!

--

--