Add CLIENT_ID and CLIENT_SECRET env var
parent
55be375897
commit
88205b1511
2
Procfile
2
Procfile
|
@ -1 +1 @@
|
|||
web: node -v ; yarn -v ; echo "APP_DIR: $APP_DIR" ; echo "PORT: $PORT" ; yarn workspace "$APP_DIR" run start:prod
|
||||
web: node -v ; yarn -v ; echo "APP_DIR => $APP_DIR" ; echo "PORT => $PORT" ; yarn workspace "$APP_DIR" run start:prod
|
||||
|
|
|
@ -30,10 +30,7 @@
|
|||
"resolveJsonModule": true,
|
||||
|
||||
/* Advanced Options */
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
|
||||
// temporary disable lib check waiting a fix for https://github.com/sindresorhus/got/issues/2051
|
||||
"skipLibCheck": true
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"ts-node": {
|
||||
"esm": true
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
CLIENT_ID=
|
||||
CLIENT_SECRET=
|
||||
MONGO_URL=mongodb://root:example@localhost:27017/
|
||||
ORIGIN=http://localhost:4000
|
||||
|
|
|
@ -1,13 +1,21 @@
|
|||
import type { MattermostSendMessage } from './mattermost.js'
|
||||
|
||||
if (!process.env.MONGO_URL) {
|
||||
throw new Error('MONGO_URL env var is empty')
|
||||
}
|
||||
|
||||
if (!process.env.CLIENT_ID || !process.env.CLIENT_SECRET) {
|
||||
throw new Error('Empty env var CLIENT_ID or CLIENT_SECRET')
|
||||
}
|
||||
|
||||
export const PORT = process.env.PORT || 4000
|
||||
export const ORIGIN = process.env.ORIGIN || 'http://localhost:4000'
|
||||
export const MONGO_URL = process.env.MONGO_URL
|
||||
export const NODE_ENV = process.env.NODE_ENV
|
||||
|
||||
export const serverUrl = 'https://mattermost.incubateur.net'
|
||||
export const clientSecret = 'pgnch7w643yfdkdjnnjcxhpsoe'
|
||||
export const clientId = 'wbkot91tjbd6byn4fbmrtu8h6o'
|
||||
export const clientId = process.env.CLIENT_ID
|
||||
export const clientSecret = process.env.CLIENT_SECRET
|
||||
export const redirectUri = `${ORIGIN}/oauth`
|
||||
|
||||
const days = [
|
||||
|
|
|
@ -10,10 +10,6 @@ interface MemberIds {
|
|||
}
|
||||
|
||||
export const initMongodb = async () => {
|
||||
if (!MONGO_URL) {
|
||||
throw new Error('MONGO_URL env var is empty')
|
||||
}
|
||||
|
||||
const client = new MongoClient(MONGO_URL)
|
||||
await client.connect()
|
||||
|
||||
|
|
Loading…
Reference in New Issue