-
Notifications
You must be signed in to change notification settings - Fork 676
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
feat(server): Add dev mode env var #1404
base: main
Are you sure you want to change the base?
Conversation
I believe I was wrong in my original comment in #1321 - Fresh already decides if it is in devmode or not based on |
Ah, good catch. I think having something explicit would still be useful; I can turn this into an abstraction. |
Ok, I made some changes, let me know what you think 🙂 |
I'm not sure I understand what we gain from exposing if Fresh is in dev mode via an environment variable. Can you share more about your use case? |
Of course. The idea is if the user wants to have different code for dev vs not dev, they can easily check against that env variable. if (Deno.env.get("FRSH_DEVMODE") === 'true') {
return new Response('Welcome to my dev site');
} else {
return new Response('Welcome to my production site');
} |
Could that usecase be resolved by a per-project env var? |
Isn't this something you could solve by just adding a |
I'm hoping this small feature will be useful for people to develop against dev and production environments.
This will also help kick off #1321, which needs this distinction.