proxy.conf.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright © 2016-2022 The Thingsboard Authors
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. const forwardUrl = "http://localhost:8080";
  17. const wsForwardUrl = "ws://localhost:8080";
  18. const ruleNodeUiforwardUrl = forwardUrl;
  19. const PROXY_CONFIG = {
  20. "/api": {
  21. "target": forwardUrl,
  22. "secure": false,
  23. },
  24. "/static/rulenode": {
  25. "target": ruleNodeUiforwardUrl,
  26. "secure": false,
  27. },
  28. "/static/widgets": {
  29. "target": forwardUrl,
  30. "secure": false,
  31. },
  32. "/oauth2": {
  33. "target": forwardUrl,
  34. "secure": false,
  35. },
  36. "/login/oauth2": {
  37. "target": forwardUrl,
  38. "secure": false,
  39. },
  40. "/api/ws": {
  41. "target": wsForwardUrl,
  42. "ws": true,
  43. "secure": false
  44. },
  45. };
  46. module.exports = PROXY_CONFIG;