This guide shows you how to deploy Razzle apps on Layer0.
This framework has a connector developed for Layer0. See Connectors for more information.
To prepare your Razzle app for deployment on Layer0, run the following in the root folder of your project:
npm install -g 0/cli 0 init
This will automatically add all of the required dependencies and files to your project. These include:
0/corepackage - Allows you to declare routes and deploy your application on Layer0
0/razzlepackage - Provides router middleware that automatically adds Razzle routes to Layer0 router.
0/prefetchpackage - Allows you to configure a service worker to prefetch and cache pages to improve browsing speed
0/reactpackage - Provides a
Prefetchcomponent 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 Layer0.
layer0.config.js- Contains configuration options for deploying on Layer0.
To simulate your app within Layer0 locally, run:
To simulate edge caching locally, run:
0 dev --cache
Deploying requires an account on Layer0. Sign up here for free. Once you have an account, you can deploy to Layer0 by running the following in the root folder of your project
See deploying for more information.