Skip to content

Latest commit

 

History

History

README.md

F1 Stats on Netlify Edge Functions

This is an example data source to retrieve our dataset using Netlify Edge Functions.

Notable things about Netlify

  • Netlify uses Deno as a runtime, so database-js needs to be pulled from a CDN. This can be seen in data.json.ts
  • Netlify requires edge functions to exist under netlify/edge-functions subdirectory.

Setup

  1. Run npm install
  2. Run npm run dev to start the app locally.
  3. Run npx netlify build
  4. Run npx netlify deploy --prod to deploy to Netlify.
  5. Run npx netlify env:set DATABASE_URL ... to configure the database credential needed.

Live endpoint

https://f1-championship-stats.netlify.app/data.json