Skip to content

Commit

Permalink
fix: 🐛 use cert as text file
Browse files Browse the repository at this point in the history
  • Loading branch information
Katze719 committed Sep 5, 2024
1 parent ebcf026 commit 5435906
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions fresh.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,11 @@ const port = Number(Deno.env.get("DENO_PORT")) || 8000;
const certFile = Deno.env.get("DENO_CERTFILE");
const keyFile = Deno.env.get("DENO_KEYFILE");

if (certFile && keyFile) {
try {
await Deno.stat(certFile);
await Deno.stat(keyFile);
} catch (error) {
console.error("Error accessing certificate or key file:", error);
Deno.exit(1);
}
} else {
console.error("Cert file or key file not specified.");
Deno.exit(1);
}
const cert = certFile ? await Deno.readTextFile(certFile) : undefined;
const key = keyFile ? await Deno.readTextFile(keyFile) : undefined;

export default defineConfig({
port: port,
cert: certFile,
key: keyFile,
cert: cert,
key: key,
});

0 comments on commit 5435906

Please sign in to comment.