This guide shows you how to deploy a RedwoodJS application to Edgio.
Deploying requires an account on Edgio. Sign up here for free.
If you have not already done so, install the Edgio CLI.
1npm i -g @edgio/cli
1yarn global add @edgio/cli
If you don’t already have a RedwoodJS app, use the terminal (or command prompt on Windows) to create one using the commands below:
1yarn create redwood-app ./my-redwood-app
To prepare your RedwoodJS app for deployment on Edgio, you can use both the RedwoodJS or Edgio CLI depending on what you prefer.
You will first need to setup Edgio as a deploy provider via:
1yarn rw setup deploy edgio
This will verify that the Edgio CLI is setup on your system and initialize the application accordingly.
For preparing using the Edgio CLI, run:
This will automatically add all of the required dependencies and files to your project. These include:
@edgio/corepackage - Allows you to declare routes and deploy your application on Edgio
@edgio/redwoodjspackage - Provides router middleware that automatically adds RedwoodJS routes to the Edgio router.
routes.js- A default routes file that sends all requests to RedwoodJS. Update this file to add caching or proxy some URLs to a different origin.
edgio.config.js- Contains configuration options for deploying on Edgio.
Test your app with the Sites on your local machine by running the following command in your project’s root directory:
To simulate edge caching locally, run:
1edgio dev --cache
You can deploy using the RedwoodJS CLI using:
1yarn rw deploy edgio
You can also deploy using the Edgio CLI with:
The deploy command for RedwoodJS takes the same deploy arguments as using Edgio to deploy. You can see all the available options using
yarn rw deploy edgio --help
See Deployments for more information.