Install the CLI. See the install docs.
Log in:
runway login
Add an SSH key. See key setup, or use the shortcut:
runway local key setup
Let’s start by building a small app using the well-known express.js library for JavaScript/NodeJS.
Create a project folder:
$ mkdir ./my-app
$ cd my-app/
Install express.js as a dependency using npm:
$ npm install express --save
$ echo "node_modules" > .gitignore
Let’s create an app.js file with the following content (inspired by the express.js hello world example):
const express = require('express')
const app = express()
const port = process.env.port || 3000
app.get('/', (req, res) => {
res.send('Hello World!')
})
app.listen(port, () => {
console.log(`Example app listening on port ${port}`)
})
3000 for local development.Define a start command in package.json:
$ npm pkg set scripts.start="node app.js"
You can test the app locally by running: npm run start and it will be available at http://localhost:3000/.
$ runway app create
$ runway app config set PORT=3000
$ git add -A
$ git commit -m "initial commit"
runway app deploy
Run runway app open to see it live, or check the Runway UI. Check runway app logs if something’s off.
Congratulations, you deployed an express.js application to Runway! 🎉