Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
feat: support for web app
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbyheart committed Jul 16, 2019
1 parent 2594878 commit 4405303
Show file tree
Hide file tree
Showing 7 changed files with 278 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier/)
[![ESLint: TypeScript](https://img.shields.io/badge/ESLint-TypeScript-blue.svg)](https://github.com/typescript-eslint/typescript-eslint)

Read the documentation at https://bifravst.gitbook.io/bifravst/v/saga/docs/aws/gettingstarted.
Read the documentation at Read the documentation at https://bifravst.gitbook.io/bifravst/v/saga/.
2 changes: 1 addition & 1 deletion cdk.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"app": "node dist/cloudformation.js"
"app": "node dist/cdk/cloudformation.js"
}
189 changes: 189 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"@typescript-eslint/eslint-plugin": "^1.12.0",
"@typescript-eslint/parser": "^1.12.0",
"cdk": "^1.0.0",
"change-case": "^3.1.0",
"eslint": "^6.0.1",
"eslint-config-prettier": "^6.0.0",
"husky": "^3.0.0",
Expand Down
22 changes: 22 additions & 0 deletions scripts/print-react-app-configuration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { CloudFormation } from 'aws-sdk'
import { toEnv } from './toEnv'

const region = process.env.AWS_DEFAULT_REGION
const cf = new CloudFormation({ region })

const STACK_ID = process.env.STACK_ID || 'bifravst'

cf.describeStacks({ StackName: STACK_ID })
.promise()
.then(async ({ Stacks }) => {
if (!Stacks || !Stacks.length || !Stacks[0].Outputs) {
throw new Error(`Stack ${STACK_ID} not found.`)
}
const env = toEnv(Stacks[0].Outputs)
process.stdout.write(env)
process.stdout.write(`REACT_APP_AWS_REGION=${region}`)
})
.catch(err => {
console.error(err)
process.exit(1)
})
Loading

0 comments on commit 4405303

Please sign in to comment.