🎉 Introducing Edgio v6 which supports Node.js v16. Learn how to upgrade. 🎉
Edgio
Edgio

Razzle

This guide shows you how to deploy a Razzle application to Edgio.

Example

Connector

This framework has a connector developed for Edgio. See Connectors for more information.

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.

Bash
1npm i -g @edgio/cli

Getting Started

To prepare your Razzle app for deployment on Edgio, run the following in the root folder of your project:

Bash
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/razzle package - Provides router middleware that automatically adds Razzle routes to Edgio router.
  • The @edgio/prefetch package - Allows you to configure a service worker to prefetch and cache pages to improve browsing speed
  • The @edgio/react package - Provides a Prefetch component for prefetching pages
  • routes.js - A default routes file that sends all requests to Razzle. Update this file to add caching or proxy some URLs to a different origin.
  • sw/service-worker.js - The source code for your service worker, which enables prefetching when running on Edgio.
  • 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:

Bash
1edgio dev

Simulate edge caching locally

To simulate edge caching locally, run:

Bash
1edgio dev --cache

Deploying

Deploy your app to the Sites by running the following command in your project’s root directory:

Bash
1edgio deploy

See Deployments for more information.