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

We didn't detect a env variable APP_KEY (fresh 1.4.3) #32

Closed
ovniroto opened this issue Sep 11, 2023 · 3 comments
Closed

We didn't detect a env variable APP_KEY (fresh 1.4.3) #32

ovniroto opened this issue Sep 11, 2023 · 3 comments

Comments

@ovniroto
Copy link

In the latest version of fresh (1.4.3) it does not detect the APP_KEY variable in the .env file.

[FRESH SESSION] Warning: We didn't detect a env variable APP_KEY, if you are in production please fix this ASAP to avoid any security issue.

@Octo8080X
Copy link
Owner

@ovniroto

Thanks for letting me know. Appreciate it.

fresh-session was not originally designed to automatically load .env files.
We also do not expect Fresh to read .env files.

Therefore, there are three options that can be taken.

  1. inline
APP_KEY=hoge deno task start
  1. system environment variables
export APP_KEY=hoge
deno task start
  1. dev.ts
#!/usr/bin/env -S deno run -A --watch=static/,routes/

import "https://deno.land/std@0.202.0/dotenv/load.ts"; // << Add.

import dev from "$fresh/dev.ts";

await dev(import.meta.url, "./main.ts");

We believe these are the best ways to address this issue.

@Octo8080X
Copy link
Owner

@ovniroto

If there is no problem with this method of response, please let us know so we can close this issue.
(Due date 10/1/2023)

@ovniroto
Copy link
Author

It has worked, thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants