Last year I wrote Blueprints for Up, describing how most of the building blocks are available to create a great serverless experience on AWS with minimal effort. This post talks about the initial alpha release of Up.

Why focus on serverless? For starters it’s cost-effective since you pay on-demand, only for what you use. Serverless options are self-healing, as each request is isolated and considered to be “stateless.” And finally it scales indefinitely with ease — there are no machines or clusters to manage. Deploy your code and you’re done.

Roughly a month ago I decided to start working on it over at apex/up, and wrote the first small serverless sample application tj/gh-polls for live SVG GitHub user polls. It worked well and costs less than $1/month to serve millions of polls, so I thought I’d go ahead with the project and see if I can offer open-source and commercial variants.

The long-term goal is to provide a “Bring your own Heroku” of sorts, supporting many platforms. While Platform-as-a-Service is nothing new, the serverless ecosystem is making this kind of program increasingly trivial. This said, AWS and others often suffer in terms of UX due to the flexibility they provide. Up abstracts the complexity away, while still providing you with a virtually ops-free solution.

Installation

You can install Up with the following command, and view the temporary documentation to get started. Or if you’re sketched out by install scripts, grab a binary release. (Keep in mind that this project is still early on.)

To upgrade to the latest version at any time just run:

up upgrade

You may also install via NPM:

npm install -g up

Features

What features does the early alpha provide? Let’s take a look! Keep in mind that Up is not a hosted service, so you’ll need an AWS account and AWS credentials. If you’re not familiar at all with AWS you may want to hold off until that process is streamlined.

The first question I always get is: how does up(1) differ from apex(1)? Apex focuses on deploying functions, for pipelines and event processing, while Up focuses on apps, apis, and static sites, aka single deployable units. Apex does not provision API Gateway, SSL certs, or DNS for you, nor does it provide URL rewriting, script injection and so on.

Single command serverless apps

Up lets you deploy apps, apis, and static sites with a single command. To create an application all you need is a single file, in the case of Node.js, an ./app.js listening on PORT which is provided by Up. Note that if you’re using a package.json Up will detect and utilize the start and build scripts.

const http = require('http')

const { PORT = 3000 } = process.env http.createServer((req, res) => {

res.end('Hello World

')

}).listen(PORT)

Additional runtimes are supported out of the box, such as main.go for Golang, so you can deploy Golang, Python, Crystal, or Node.js applications in seconds.

package main import (

"fmt"

"log"

"net/http"

"os"

) func main() {

addr := ":" + os.Getenv("PORT")

http.HandleFunc("/", hello)

log.Fatal(http.ListenAndServe(addr, nil))

} func hello(w http.ResponseWriter, r *http.Request) {

fmt.Fprintln(w, "Hello World from Go")

}