Skip to content

Commit

Permalink
fix(dashboard): fix contants import in setupProxy.js
Browse files Browse the repository at this point in the history
  • Loading branch information
eysi09 committed Dec 11, 2018
1 parent f24ca54 commit e2c5bbd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
14 changes: 14 additions & 0 deletions garden-dashboard/src/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright (C) 2018 Garden Technologies, Inc. <info@garden.io>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

// NOTE: This file only supports Node's JavaScript syntax because it's imported by setupProxy.js.
// See: https://facebook.github.io/create-react-app/docs/proxying-api-requests-in-development#configuring-the-proxy-manually

module.exports = {
GARDEN_SERVICE_DEFAULT_PORT: 9777
}
9 changes: 0 additions & 9 deletions garden-dashboard/src/constants.ts

This file was deleted.

4 changes: 2 additions & 2 deletions garden-dashboard/src/setupProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
// Proxy requests from the development server to the correct port on the garden-service server.
// See: https://facebook.github.io/create-react-app/docs/proxying-api-requests-in-development#configuring-the-proxy-manually

// NOTE: This file must be named "src/setupProxy.js".
// NOTE: This file must be named "src/setupProxy.js" and only supports Node's Javascript syntax.

const proxy = require("http-proxy-middleware")

const { GARDEN_SERVICE_DEFAULT_PORT } = require("constants")
const { GARDEN_SERVICE_DEFAULT_PORT } = require("./constants")

module.exports = function(app) {
const port = process.env.GARDEN_SERVICE_PORT || GARDEN_SERVICE_DEFAULT_PORT
Expand Down

0 comments on commit e2c5bbd

Please sign in to comment.