@koloseum/utils 0.2.22 → 0.2.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/utils.js +43 -16
  2. package/package.json +1 -1
package/dist/utils.js CHANGED
@@ -519,19 +519,19 @@ export const Utility = {
519
519
  if (microserviceGroup === "public") {
520
520
  // Initialise subdomain for production
521
521
  let subdomain = "";
522
- // Set subdomain and port number for Authentication microservice
522
+ // Handle Authentication microservice
523
523
  if (path.startsWith("auth")) {
524
524
  subdomain = "auth.";
525
525
  port = 5173;
526
526
  path = path.replace("auth", "");
527
527
  }
528
- // Set subdomain and port number for Legal microservice
528
+ // Handle Legal microservice
529
529
  else if (path.startsWith("legal")) {
530
530
  subdomain = "legal.";
531
531
  port = 5174;
532
532
  path = path.replace("legal", "");
533
533
  }
534
- // Set port number for Landing microservice
534
+ // Handle Landing microservice
535
535
  else if (path.startsWith("landing")) {
536
536
  port = 5184;
537
537
  path = path.replace("landing", "");
@@ -543,38 +543,65 @@ export const Utility = {
543
543
  : `http://127.0.0.1:${port}${path || ""}`
544
544
  };
545
545
  }
546
- // Set port number for Players microservices
546
+ // Handle Players microservices
547
547
  if (microserviceGroup === "players") {
548
- if (path.startsWith("account"))
548
+ if (path.startsWith("account")) {
549
549
  port = 5175;
550
- if (path.startsWith("fgc"))
550
+ if (env === "development")
551
+ path = path.replace("account", "");
552
+ }
553
+ if (path.startsWith("fgc")) {
551
554
  port = 5178;
552
- if (path.startsWith("commerce"))
555
+ if (env === "development")
556
+ path = path.replace("fgc", "");
557
+ }
558
+ if (path.startsWith("commerce")) {
553
559
  port = 5179;
560
+ if (env === "development")
561
+ path = path.replace("commerce", "");
562
+ }
554
563
  }
555
- // Set port number for Lounges microservices
564
+ // Handle Lounges microservices
556
565
  if (microserviceGroup === "lounges") {
557
- if (path.startsWith("branches"))
566
+ if (path.startsWith("branches")) {
558
567
  port = 5181;
559
- if (path.startsWith("staff"))
568
+ if (env === "development")
569
+ path = path.replace("branches", "");
570
+ }
571
+ if (path.startsWith("staff")) {
560
572
  port = 5182;
573
+ if (env === "development")
574
+ path = path.replace("staff", "");
575
+ }
561
576
  }
562
- // Set port number for Backroom microservices
577
+ // Handle Backroom microservices
563
578
  if (microserviceGroup === "backroom") {
564
- if (path.startsWith("compliance"))
579
+ if (path.startsWith("compliance")) {
565
580
  port = 5176;
566
- if (path.startsWith("competitions"))
581
+ if (env === "development")
582
+ path = path.replace("compliance", "");
583
+ }
584
+ if (path.startsWith("competitions")) {
567
585
  port = 5177;
568
- if (path.startsWith("commerce"))
586
+ if (env === "development")
587
+ path = path.replace("competitions", "");
588
+ }
589
+ if (path.startsWith("commerce")) {
569
590
  port = 5180;
570
- if (path.startsWith("staff"))
591
+ if (env === "development")
592
+ path = path.replace("commerce", "");
593
+ }
594
+ if (path.startsWith("staff")) {
571
595
  port = 5183;
596
+ if (env === "development")
597
+ path = path.replace("staff", "");
598
+ }
572
599
  }
573
600
  // Return redirect URL
574
601
  return {
575
602
  url: env === "production"
576
603
  ? `https://${microserviceGroup}.koloseum.ke/${path || ""}`
577
- : `http://127.0.0.1:${port}/${path || ""}`
604
+ : `http://127.0.0.1:${port}${path || ""}`
578
605
  };
579
606
  },
580
607
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koloseum/utils",
3
- "version": "0.2.22",
3
+ "version": "0.2.23",
4
4
  "author": "Koloseum Technologies Limited",
5
5
  "type": "module",
6
6
  "description": "Utility logic for use across Koloseum web apps (TypeScript)",