Skip to content

Commit

Permalink
DEV: add database name to environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
dwhieb committed Apr 30, 2023
1 parent b91e277 commit f0460c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
workflow_dispatch:

env:
COSMOS_DB_NAME: test
COSMOS_ENDPOINT: https://digitallinguistics.documents.azure.com:443/
COSMOS_KEY: ${{ secrets.COSMOS_KEY }}
LOGGING: TRUE
Expand Down
7 changes: 1 addition & 6 deletions bin/setupDatabase.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import '../env.js'
import Database from '@digitallinguistics/db'

const [, , dbName] = process.argv

if (!dbName) {
throw new Error(`Provide a database name as the first argument.`)
}

const dbName = process.env.COSMOS_DB_NAME
const endpoint = process.env.COSMOS_ENDPOINT
const key = process.env.COSMOS_KEY
const db = new Database({ dbName, endpoint, key })
Expand Down

0 comments on commit f0460c1

Please sign in to comment.