mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 11:30:12 +08:00
add dotenv to server
This commit is contained in:
1 parent
7216158053
commit
ba3b40792b
3 files changed
+10
-4
No files matched your search
+2
-1
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"watch": ["dist", "swagger.yaml", "../quests", "../packages"],
|
"watch": ["dist", "swagger.yaml", "../quests", "../packages"],
|
||||||
"ext": "js,ts,yaml,yml",
|
"ext": "js,ts,yaml,yml",
|
||||||
"exec": "node dist/index.js"
|
"exec": "node dist/index.js",
|
||||||
|
"delay": 200
|
||||||
}
|
}
|
||||||
+4
-3
@@ -5,12 +5,12 @@
|
|||||||
"type": "commonjs",
|
"type": "commonjs",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node dist/index.js",
|
"start": "node dist/index.js",
|
||||||
"dev": "concurrently \"yarn build -w\" \"nodemon\"",
|
"dev": "nodemon",
|
||||||
"test": "yarn node --experimental-vm-modules $(yarn bin jest)",
|
"test": "yarn node --experimental-vm-modules $(yarn bin jest)",
|
||||||
"setup": "node dist/cli/setup.js",
|
"setup": "node dist/cli/setup.js",
|
||||||
"clean": "node dist/cli/clean.js",
|
"clean": "node dist/cli/clean.js",
|
||||||
"build": "tsc --build",
|
"build": "tsc",
|
||||||
"build:quests": "node src/cli/build.js"
|
"build:quests": "node dist/cli/build.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@linux-odyssey/constants": "*",
|
"@linux-odyssey/constants": "*",
|
||||||
@@ -21,6 +21,7 @@
|
|||||||
"commander": "^11.0.0",
|
"commander": "^11.0.0",
|
||||||
"connect-mongo": "^5.0.0",
|
"connect-mongo": "^5.0.0",
|
||||||
"dockerode": "^3.3.5",
|
"dockerode": "^3.3.5",
|
||||||
|
"dotenv": "^16.4.1",
|
||||||
"express": "^4.18.2",
|
"express": "^4.18.2",
|
||||||
"express-rate-limit": "^7.1.3",
|
"express-rate-limit": "^7.1.3",
|
||||||
"express-session": "^1.17.3",
|
"express-session": "^1.17.3",
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
import validator from 'validator'
|
import validator from 'validator'
|
||||||
import { get } from './utils/env.js'
|
import { get } from './utils/env.js'
|
||||||
|
|
||||||
|
// Import dotenv and load ../.env
|
||||||
|
import dotenv from 'dotenv'
|
||||||
|
dotenv.config({ path: '../.env' })
|
||||||
|
|
||||||
function getTrustProxies(key) {
|
function getTrustProxies(key) {
|
||||||
if (!process.env[key]) {
|
if (!process.env[key]) {
|
||||||
return []
|
return []
|
||||||
|
|||||||
Reference in new issue
Block a user