Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(cloudflare): add environment variables instructions #1547

Merged
merged 5 commits into from
Aug 20, 2023
Merged

Conversation

Hebilicious
Copy link
Member

@Hebilicious Hebilicious commented Aug 7, 2023

πŸ”— Linked issue

Resolves #272
Extracted from #1318

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Document the usage of environment variables and useRuntimeConfig in cloudflare presets.
useRuntimeConfig(event) only works with unenv.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codecov
Copy link

codecov bot commented Aug 7, 2023

Codecov Report

Merging #1547 (96b9f89) into main (a949cb9) will not change coverage.
Report is 41 commits behind head on main.
The diff coverage is n/a.

❗ Current head 96b9f89 differs from pull request most recent head d1d8ef4. Consider uploading reports for the commit d1d8ef4 to get more accurate results

@@           Coverage Diff           @@
##             main    #1547   +/-   ##
=======================================
  Coverage   76.47%   76.47%           
=======================================
  Files          73       73           
  Lines        7591     7591           
  Branches      757      757           
=======================================
  Hits         5805     5805           
  Misses       1785     1785           
  Partials        1        1           

@Hebilicious Hebilicious changed the title docs(cloudflare): add environment variables instructions docs: add environment variables instructions Aug 7, 2023
@Hebilicious Hebilicious changed the title docs: add environment variables instructions docs(cloudflare): add environment variables instructions Aug 7, 2023
@Hebilicious
Copy link
Member Author

@pi0 A new section is in #1550, this PR only contains cloudflare specific instructions

@Hebilicious
Copy link
Member Author

Hebilicious commented Aug 11, 2023

@pi0 When you get the time to look at this, could you also clarify why/how we can use useRuntimeConfig() without event in defineLazyEventHandlers ? This pattern isn't documented anywhere.

@pi0
Copy link
Member

pi0 commented Aug 20, 2023

@Hebilicious

export default lazyEventHandler(() => {
  // Access here
  return eventHandler(() => {
    
  })
})

We can mention it in both routing and config sections.

@pi0 pi0 merged commit e35e6b2 into main Aug 20, 2023
5 of 7 checks passed
@pi0 pi0 deleted the docs/cloudflare-env branch August 20, 2023 22:24
@pi0 pi0 mentioned this pull request Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation preset:cloudflare
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support cloudflare environment variables
2 participants