Skip to content

Commit

Permalink
πŸ› FIX: Make .env work! (#36)
Browse files Browse the repository at this point in the history
* ❎ SAVE: Do as stated in the given issue
vercel/next.js#7320
Everything breaks after making this change to the code.

* πŸ‘Œ IMPROVE: Update nextjs

* πŸ‘Œ IMPROVE: Specify node version for heroku

* πŸ‘Œ IMPROVE: Install momentjs

* ❎ SAVE: Use env in withData
  • Loading branch information
kumarabhirup committed May 13, 2019
1 parent d2bf93e commit eb8908b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
11 changes: 10 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ module.exports = withSass({
return config
},
env: {
'PROD_DOMAIN': process.env.PROD_DOMAIN
'PROD_DOMAIN': process.env.PROD_DOMAIN,
'BACKEND_SERVER': process.env.BACKEND_SERVER,
'FB_LOGIN_APP_ID': process.env.FB_LOGIN_APP_ID,
'GOOGLE_LOGIN_APP_ID': process.env.GOOGLE_LOGIN_APP_ID,
'GOOGLE_LOGIN_APP_SECRET': process.env.GOOGLE_LOGIN_APP_SECRET,
'FB_LOGIN_APP_VERSION': process.env.FB_LOGIN_APP_VERSION,
'DEV_DOMAIN': process.env.DEV_DOMAIN,
'ENDPOINT': process.env.ENDPOINT,
'GA_TRACKING_ID': process.env.GA_TRACKING_ID,
'CLOUDINARY_USERNAME': process.env.CLOUDINARY_USERNAME
}
})
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
"lodash.debounce": "^4.0.8",
"lodash.isempty": "^4.4.0",
"lodash.once": "^4.1.1",
"next": "^7.0.2",
"moment": "^2.24.0",
"next": "^8.1.0",
"next-images": "^1.0.4",
"next-with-apollo": "^3.3.2",
"node-sass": "^4.11.0",
Expand All @@ -55,13 +56,13 @@
"prismjs": "^1.15.0",
"prop-types": "15.7.2",
"random-hex-color": "^1.0.1",
"react": "^16.8.4",
"react": "^16.8.6",
"react-apollo": "^2.5.4",
"react-bootstrap": "^1.0.0-beta.5",
"react-day-picker": "^7.3.0",
"react-dnd": "^7.3.1",
"react-dnd-html5-backend": "^7.2.0",
"react-dom": "^16.8.4",
"react-dom": "^16.8.6",
"react-facebook-auth": "^1.4.0",
"react-facebook-login": "^4.1.1",
"react-ga": "^2.5.7",
Expand All @@ -84,5 +85,8 @@
"resolutions": {
"terser": "3.14.1",
"graphql-anywhere": "4.1.0"
},
"engines": {
"node": "11.4.0"
}
}
4 changes: 2 additions & 2 deletions src/lib/withData.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import withApollo from 'next-with-apollo'
import ApolloClient from 'apollo-boost'

export const client = new ApolloClient({
uri: `https://paprink-server.herokuapp.com/graphql`,
uri: `${process.env.ENDPOINT}/graphql`,
request: operation => {
operation.setContext({
fetchOptions: {
Expand All @@ -15,7 +15,7 @@ export const client = new ApolloClient({
function createClient({ headers }) {

return new ApolloClient({
uri: `https://paprink-server.herokuapp.com/graphql`,
uri: `${process.env.ENDPOINT}/graphql`,
request: operation => {
operation.setContext({
fetchOptions: {
Expand Down

0 comments on commit eb8908b

Please sign in to comment.