Working with up

Up is a deploy tool from @tjholowaychuk, and its perhaps the best tool I've used in a while. up takes your site and deploys it on a reverse proxy on AWS lambda, with every route hit counting as a lambda function invocation.

It also reduces your hosting costs to $0.

Seriously - its free to host with up. Play around with the numbers here and see how cheap it is to build with up.

This tool is still in early development (v0.3.0 at time of writing) but it avoids major pain points that I have had with most deploy tools.

  • Up is simple - its not trying to do literally everything and suffers no bloat
  • This narrow feature is very polished for how new the tool is
  • The tool automates just the right amount, leaving the developer in control of any situation

Ultimately, up feels like it was a tool built by a seasoned developer to automate a specific series of tasks.

Getting your deploy on

So, how do you use it? Heres, in 5 lines, is a deployment of an example project:

git clone [email protected]:apex/up-examples.git
cd up-examples/oss/node-express
npm i
up # this does the deploy
up url --open # a shortcut to open the application in your browser

And there you have it - a deployed express application. Any new deploys can be run by running up again. I recommend looking over the docs for 10 minutes to see the full range of things you can do.

Notes and other tricks

Here are a few non-obvious things I've learned from migrating my various applications to up.

Keeping the service warm

There is a non-trivial delay (~3-5sec!) when an service is first hit, but no delays after. This is result of AWS having to spin up the lambda into a warm state. Once the lambda is live, there is no delay for any requests. The best way around this is a CloudWatch rule that will ping your service about once a minute.

Deploy packages

up zips your current working directory and uploads it as the deploy artifact. Watch out for packages that are linked or not installed in the first place - they are not going to magically appear on your app.

Email accessibility on custom domains

Make sure you have a way to get emails on "[email protected]" when using a custom domain. You need to respond to emails to authorize ACM certificates.

Filesystem woes

Since this is on AWS lambda you don't have write access to the filesystem. This makes up incompatible with some larger projects such as ghost.

Happy hacking!

Keep Reading

A simple D3 plugin

Reusable and Extendable D3 Charts