mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Throw an error if requried env vars are missing
This commit is contained in:
parent
e9bc848a33
commit
30d4318d17
@ -14,6 +14,13 @@ import jwtStrategy from './jwt/strategy'
|
||||
import jwt from 'jsonwebtoken'
|
||||
|
||||
dotenv.config()
|
||||
// check env and warn
|
||||
const requiredEnvVars = ['MAPBOX_TOKEN', 'JWT_SECRET']
|
||||
requiredEnvVars.forEach(env => {
|
||||
if (!process.env[env]) {
|
||||
throw new Error(`ERROR: "${env}" env variable is missing`)
|
||||
}
|
||||
})
|
||||
|
||||
let schema = makeExecutableSchema({
|
||||
typeDefs,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user