A starter template for building a Server-Side Rendered (SSR) Astro app with Netlify Edge Functions.
This demo uses Astro's @astrojs/netlify
package to deploy your site with SSR enabled. The application will detect the location of the user requesting the page and will render it in the browser.
Visit https://astro-edge-functions-demo.netlify.app/ to see the code in this repository in action.
To get started with local development, follow the instructions below in your terminal application.
-
Clone this repository locally:
git clone https://github.com/sarahetter/astro-netlify-edge-starter
-
Navigate to the repository folder:
cd astro-netlify-edge-starter
-
Install the package dependencies:
npm install
-
Start the application:
npm run dev
If the command was successful, you should be able to get a local URL that you can open in your browser.
Keep in mind that because you are running the application locally, the geolocation component will not work. Once you deploy the application to Netlify, the location should be correctly identified.
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.
If the command is successful, you should see a URL to your site in the terminal.
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.