-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use dotenv properly, get api token for jami
- Loading branch information
Showing
7 changed files
with
37 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
API_TOKEN=<API_TOKEN> | ||
API_TOKEN=<API_TOKEN> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
name: Deploy to staging | ||
|
||
on: push | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
test: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,7 @@ | ||
export const PORT = process.env.PORT || 8000 | ||
|
||
export const DB_CONFIG = { | ||
dialect: 'postgres', | ||
pool: { | ||
max: 10, | ||
min: 0, | ||
acquire: 10000, | ||
idle: 300000000, | ||
}, | ||
username: process.env.POSTGRES_USER, | ||
password: process.env.POSTGRES_PASSWORD, | ||
port: 5432, | ||
host: process.env.POSTGRES_HOST, | ||
database: process.env.POSTGRES_DATABASE, | ||
logging: false, | ||
} | ||
|
||
export const inStaging = process.env.REACT_APP_STAGING === 'true' | ||
|
||
export const inProduction = !inStaging && process.env.NODE_ENV === 'production' | ||
|
||
export const inE2EMode = process.env.REACT_APP_E2E === 'true' | ||
|
||
export const GIT_SHA = process.env.REACT_APP_GIT_SHA || '' | ||
|
||
export const JAMI_URL = inProduction | ||
? 'https://importer.cs.helsinki.fi/api/auth' | ||
: 'https://toska-staging.cs.helsinki.fi/jami' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import * as dotenv from 'dotenv' | ||
|
||
import { inProduction } from '../../config' | ||
|
||
dotenv.config() | ||
|
||
export const PORT = process.env.PORT || 8000 | ||
|
||
export const { API_TOKEN } = process.env | ||
|
||
export const DB_CONFIG = { | ||
dialect: 'postgres', | ||
pool: { | ||
max: 10, | ||
min: 0, | ||
acquire: 10000, | ||
idle: 300000000, | ||
}, | ||
username: process.env.POSTGRES_USER, | ||
password: process.env.POSTGRES_PASSWORD, | ||
port: 5432, | ||
host: process.env.POSTGRES_HOST, | ||
database: process.env.POSTGRES_DATABASE, | ||
logging: false, | ||
} | ||
|
||
export const JAMI_URL = inProduction | ||
? 'https://importer.cs.helsinki.fi/api/auth' | ||
: 'https://toska-staging.cs.helsinki.fi/jami' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters