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 a new react application. For the tutorial, we’ll use create-react-app which sets up a standard react-based app and demonstrate how easy it is to run it Runway.
Create a new application:
$ npx create-react-app my-app
This may take a couple of minutes, but once it’s done, you can test the app by changing into the my-app directory and running npm start.
$ cd my-app
$ runway app create
When you push the app code, Runway will run npm run build which produces all the static assets required to run the app, but we’ll still be missing a web server.
One of the options is to add an Nginx (e.g. see the Angular tutorial), another option is to add a small JavaScript-based web server:
$ npm install serve
...
And re-configure how the app is started:
$ npm pkg set scripts.dev="react-scripts start"
$ npm pkg set scripts.start="serve -s build"
Hold on a second - we just changed two things:
npm run devnpm run startnpm ci for good measure and git-commit your changes.$ runway app config set PORT=3000
runway app deploy
Run runway app open to see it live, or check the Runway UI. Check runway app logs if something’s off.
Congrats! You built a React app and it’s running on Runway! 🚀