Runway

astro

Let’s create an astro app and deploy it to Runway.

Setup

Create the project:

$ npm create astro@latest
...

The tool will guide you through several questions โ€” anything is possible. The key things to remember are to install the project in your desired location and allow it to initialize a Git repository. Everything else, like choosing between TypeScript or JavaScript and setting up strictness levels, is entirely up to you.

We’ll assume, you installed into my-app, so let’s change into the directory and add a node adapter to your project:

$ cd my-app
$ npx astro add node
...

This will configure the build process as well, and allow us to run the app standalone.

Create an app

Create the app on Runway:

$ runway app create
INFO    checking login status                        
INFO    created app "unique-eclipse"                 
create app unique-eclipse: done
next steps:  
* commit your changes  
* runway app deploy  
* runway open

Config

By default, astro’s build process will be “standalone” (vs. astro as part of another app) and create the artifact in the dist/server directory. Our next step is to configure your app to use this file to start:

$ npm pkg set scripts.start="node ./dist/server/entry.mjs"

Runway

By default, an astro app runs on port 4321 and is accessible only on localhost. To deploy with Runway, add the PORT and HOST settings to your appโ€™s configuration:

$ runway app config set PORT=4321 HOST=0.0.0.0
INFO    configuring app "unique-eclipse"         
configure app unique-eclipse: done
Name  Value  
HOST 0.0.0.0 
PORT 4321

Deploy

$ runway app deploy && runway open

Congratulations, young astronaut! You’re app is on Runway! ๐Ÿง‘๐Ÿผโ€๐Ÿš€๐Ÿ‘จ๐Ÿพโ€๐Ÿš€