mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 03:20:12 +08:00
feat: add basic auth to analytics
This commit is contained in:
1 parent
8430ce4428
commit
1ab394f187
4 files changed
+37
No files matched your search
@@ -1,7 +1,16 @@
|
||||
function getOrFailed(key) {
|
||||
if (!process.env[key]) {
|
||||
throw new Error(`Missing required environment variable: ${key}`)
|
||||
}
|
||||
return process.env[key]
|
||||
}
|
||||
|
||||
const config = {
|
||||
host: process.env.HOST || 'localhost',
|
||||
port: process.env.PORT || 3001,
|
||||
db: process.env.MONGO_URL || 'mongodb://localhost:27017/odyssey-test',
|
||||
username: getOrFailed('USERNAME'),
|
||||
password: getOrFailed('PASSWORD'),
|
||||
}
|
||||
|
||||
config.baseUrl = process.env.BASE_URL || `http://${config.host}:${config.port}`
|
||||
|
||||
Reference in new issue
Block a user