Skip to content

ericapisani/sample-redwoodjs-with-edge-netlify

Repository files navigation

Using Netlify Edge Functions with RedwoodJS

A starter example that shows how to use RedwoodJS with Netlify Edge Functions.

Deploy to Netlify

The example shows how geolocation through the Netlify Edge Functions can be used to determine what page needs to be rendered for each region. For example, if you are from the US, you might get some hints as to what is football and what is not.

Demo site

Visit https://redwood-with-edge-demo.netlify.app/ to see the code in this repository in action.

Example of a result from a RedwoodJS-powered application on Netlify Edge Functions

Prerequisites

  • RedwoodJS requires Node.js (>=14.19.x <=16.x) and Yarn (>=1.15) installed.
  • Using Netlify Edge Functions locally requires the Netlify CLI installed.

Local development

To get stated with local development, follow the instructions below in your terminal application:

  1. Clone this repository locally:

    git clone https://github.com/ericapisani/sample-redwoodjs-with-edge-netlify
  2. Navigate to the repository folder:

    cd sample-redwoodjs-with-edge-netlify
  3. Install the package dependencies:

    yarn install
  4. Start the application using the Netlify CLI (this will ensure that the Edge Function is executed as well):

    netlify dev

If the command is successful, you should see a new browser window open with the application running locally.

Running the application locally

Deploying the project to Netlify

To deploy the project to Netlify, make sure that you have the Netlify CLI installed. You can install the Netlify CLI globally by running this command in the terminal:

npm install netlify-cli -g

Once the CLI is installed, run the deployment command in the terminal:

netlify deploy --build

Once the command is executed, you'll be prompted for information about the site where the code needs to be deployed.

Example of deployment to a new Netlify site

If the command is successful, you should see a URL to your site in the terminal.

Questions and troubleshooting

If you found an issue with the code in this repository, feel free to open an issue or let us know in the Netlify Forums.

About

Example showing how to use Netlify Edge Functions with RedwoodJS

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published