Introduction
The Astro Netlify Edge Starter is a template project that demonstrates how to build a Server-Side Rendered (SSR) Astro application using Netlify Edge Functions. This starter template showcases the integration of Astro's powerful features with Netlify's edge computing capabilities, enabling developers to create high-performance, location-aware web applications.
Main Features
- Server-Side Rendering (SSR) with Astro
- Integration with Netlify Edge Functions
- Geolocation detection for personalized content
- Fast performance through edge computing
- Easy deployment to Netlify
- TypeScript support for enhanced development experience
- Minimalistic project structure for easy customization
Installation Steps
Clone the repository:
git clone https://github.com/sarahetter/astro-netlify-edge-starter
Navigate to the project directory:
cd astro-netlify-edge-starter
Install dependencies:
npm install
Start the development server:
npm run dev
Open your browser and visit the local development URL provided in the terminal.
Usage Instructions
Modify or add Astro pages in the
src/pages
directory.Customize components in the
src/components
folder.Update styles and layouts as needed.
Test your changes locally using
npm run dev
.Deploy to Netlify:
- Install Netlify CLI globally:
npm install netlify-cli -g
- Run the deployment command:
netlify deploy --build
- Follow the prompts to complete the deployment process.
- Install Netlify CLI globally:
Access your deployed site using the URL provided by Netlify.
Verify that the geolocation feature works correctly on the deployed site.
Continue developing and push changes to your repository for automatic deployments.
Important Notes
The geolocation feature will not work in local development. It only functions when deployed to Netlify.
This starter uses the
@astrojs/netlify
package to enable SSR on Netlify.The project is configured to use Netlify Edge Functions, which run on Netlify's global edge network.
TypeScript is supported out of the box for type-safe development.
The
netlify.toml
file contains configuration for Netlify, including the use of Edge Functions.The starter template is minimal, allowing for easy customization and expansion.
Issues with the starter can be reported on the GitHub repository's issue tracker.
For additional help, you can visit the Netlify Forums.
The project is licensed under the MIT License, allowing for flexible use and modification.
Regular updates to Astro or Netlify may require adjustments to the project configuration.