This guide shows you how to deploy a RedwoodJS application to Edgio.
Example
Connector
System Requirements
Sign up for Edgio
Deploying requires an account on Edgio. Sign up here for free.
Install the Edgio CLI
If you have not already done so, install the Edgio CLI.
1npm i -g @edgio/cli
Getting Started
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.
Using RedwoodJS CLI
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.
Using the Edgio CLI
For preparing using the Edgio CLI, run:
1edgio init
This will automatically add all of the required dependencies and files to your project. These include:
- The
@edgio/core
package - Allows you to declare routes and deploy your application on Edgio - The
@edgio/redwoodjs
package - 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.
Running Locally
Test your app with the Sites on your local machine by running the following command in your project’s root directory:
1edgio dev
Simulate edge caching locally
To simulate edge caching locally, run:
1edgio dev --cache
Deploying
You can deploy using the RedwoodJS CLI using:
1yarn rw deploy edgio
You can also deploy using the Edgio CLI with:
1edgio deploy
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.