Skip to content
This repository was archived by the owner on Sep 8, 2018. It is now read-only.

Commit e3a22d5

Browse files
committed
Use a "smart configuration", also known as switching between dev and prod
1 parent 41afb29 commit e3a22d5

File tree

10 files changed

+15
-7
lines changed

10 files changed

+15
-7
lines changed

src/App.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import './sass/index.css'
88
import Header from './components/Header'
99
import Footer from './components/Footer'
1010

11-
import config from './config.json'
11+
import config from './config/index.js'
1212

1313
class App extends Component {
1414
constructor (props) {

src/components/Header.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Background from '../images/background.jpg'
33
import PropTypes from 'prop-types'
44
import { Link } from 'react-router-dom'
55

6-
import config from './../config.json'
6+
import config from './../config/index.js'
77

88
const style = {
99
backgroundImage: `url(${Background})`

src/components/ImageDrag.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Sortable, { SortableContainer } from 'react-anything-sortable'
33
import 'react-anything-sortable/sortable.css'
44
import PropTypes from 'prop-types'
55

6-
import config from './../config.json'
6+
import config from './../config/index.js'
77

88
export default class ImageDrag extends Component {
99
constructor (props) {

src/components/ImageStrip.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
33
import Slider from 'react-slick'
44
// import { Link } from 'react-router-dom'
55

6-
import config from './../config.json'
6+
import config from './../config/index.js'
77

88
export default class ImageStrip extends Component {
99
render () {

src/config/development.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"API_URI": "http://127.0.0.1:8080/",
3+
"CDN_URI": "https://terminal.ink/assets/images/"
4+
}

src/config/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const environment = process.env.NODE_ENV || 'development'
2+
3+
module.exports = require(`./${environment}.json`) // eslint-disable-line
4+
// This episode of LinusTechTips was brought to you by `eslint-disable-line`!
File renamed without changes.

src/routers/AllBots.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import BotList from './../components/BotList'
33
import Loading from './../components/Loading'
44
import ErrorBox from './../components/ErrorBox'
55

6-
import config from './../config.json'
6+
import config from './../config/index.js'
77

88
export default class AllBots extends Component {
99
constructor (props) {

src/routers/EditBot.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import ImageDrag from './../components/ImageDrag'
66
import Loading from './../components/Loading'
77
import ErrorBox from './../components/ErrorBox'
88

9-
import config from './../config.json'
9+
import config from './../config/index.js'
1010

1111
export default class EditBot extends Component {
1212
constructor (props) {

src/routers/Home.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import ImageStrip from './../components/ImageStrip'
55
import ErrorBox from './../components/ErrorBox'
66
import Loading from './../components/Loading'
77

8-
import config from './../config.json'
8+
import config from './../config/index.js'
99

1010
export default class Home extends Component {
1111
constructor (props) {

0 commit comments

Comments
 (0)