Skip to content

Commit 3bcce7c

Browse files
authored
Implement API key validation in app.js
Add API key check and secure startup message
1 parent d6a2e5c commit 3bcce7c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

app.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const apiKey = process.env.WEATHER_API_KEY;
2+
if (!apiKey) {
3+
console.error("CRITICAL ERROR: No API Key found!");
4+
process.exit(1);
5+
}
6+
console.log("App is running securely.");

0 commit comments

Comments
 (0)