-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
27 lines (22 loc) · 873 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import React from 'react'
import ReactDOM from 'react-dom'
import './stylesheets/App.css'
import './lib/font-awesome-4.7.0/css/font-awesome.min.css'
import App from './App'
import { HttpLink } from 'apollo-link-http';
import { InMemoryCache } from 'apollo-cache-inmemory'
import { ApolloProvider } from 'react-apollo'
import {ApolloClient} from 'apollo-client'
// should prob use ENV
//const API_URI = "http://45.79.171.179:3333/graphql/"
const API_URL= (process.env.NODE_ENV === 'production') ? process.env.REACT_APP_API_URL_PROD : process.env.REACT_APP_API_URL_DEV
const client = new ApolloClient({
link: new HttpLink({uri: API_URL}),
cache: new InMemoryCache()
})
console.log('Interra 311 Demo', process.env.NODE_ENV, API_URL, process.env)
ReactDOM.render((
<ApolloProvider client={client}>
<App />
</ApolloProvider>
), document.getElementById('root'))