Skip to content

Commit

Permalink
Use .env for api key. Fixes #1
Browse files Browse the repository at this point in the history
  • Loading branch information
fangeugene committed Feb 27, 2019
1 parent e3e4e56 commit a243274
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
21 changes: 21 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 @@ -34,6 +34,7 @@
"webpack-dev-server": "^3.1.3"
},
"dependencies": {
"dotenv-webpack": "^1.7.0",
"jsonwebtoken": "^8.3.0",
"react": "^16.7.0",
"react-custom-scrollbars": "^4.2.1",
Expand Down
2 changes: 1 addition & 1 deletion src/util/TBAAPI.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const TBA_AUTH_KEY = 'EpSdC0FOdvkX9DjiXnrEVVAKCTsG0jbHWugC5Drwxu0C7HtmMJ0ais7gl91uFgdi'
const TBA_AUTH_KEY = process.env.TBA_AUTH_KEY

export const fetchEvent = (eventKey) => {
return fetch(
Expand Down
4 changes: 3 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const fs = require('fs')
const path = require("path")
const webpack = require("webpack")
const HtmlWebpackPlugin = require('html-webpack-plugin')
const Dotenv = require('dotenv-webpack')

// defines where the bundle file will live
const bundlePath = path.resolve(__dirname, "dist/")
Expand Down Expand Up @@ -44,7 +45,8 @@ module.exports = (_env,argv)=> {

// edit webpack plugins here!
let plugins = [
new webpack.HotModuleReplacementPlugin()
new webpack.HotModuleReplacementPlugin(),
new Dotenv(),
]

for(name in entryPoints){
Expand Down

0 comments on commit a243274

Please sign in to comment.