|
1 | 1 | package com.cit.application.controllers; |
2 | 2 |
|
| 3 | +import java.util.Map; |
| 4 | + |
3 | 5 | import org.springframework.beans.factory.annotation.Value; |
4 | 6 | import org.springframework.web.bind.annotation.GetMapping; |
5 | 7 | import org.springframework.web.bind.annotation.RestController; |
@@ -41,6 +43,35 @@ public MicroFrontend microfontend() { |
41 | 43 | return new MicroFrontend(mfe1); |
42 | 44 | } |
43 | 45 |
|
| 46 | + @GetMapping("/api/manifests") |
| 47 | + public MicroFrontend[] microfontends() { |
| 48 | + Manifest mfe1 = new Manifest(remoteEntry, exposedModule, displayName, routePath, ngModuleName, type); |
| 49 | + Manifest mfe2 = new Manifest(remoteEntry, "./Plans", "Plans", "/plans", "PlansModule", "module"); |
| 50 | + return new MicroFrontend[] {new MicroFrontend(mfe1), new MicroFrontend(mfe2)}; |
| 51 | + } |
| 52 | + |
| 53 | + @GetMapping("/api/manifests2") |
| 54 | + public Map<String,Object> mfe() { |
| 55 | + return Map.of( |
| 56 | + "orders", |
| 57 | + Map.of( |
| 58 | + "remoteEntry", remoteEntry, |
| 59 | + "exposedModule", exposedModule, |
| 60 | + "displayName", displayName, |
| 61 | + "routePath", routePath, |
| 62 | + "ngModuleName", ngModuleName, |
| 63 | + "type", type), |
| 64 | + "plans", |
| 65 | + Map.of( |
| 66 | + "remoteEntry", remoteEntry, |
| 67 | + "exposedModule", "./plans", |
| 68 | + "displayName", "Plans", |
| 69 | + "routePath", "plans", |
| 70 | + "ngModuleName", "PlansModule", |
| 71 | + "type", "module") |
| 72 | + ); |
| 73 | + } |
| 74 | + |
44 | 75 | public static class MicroFrontend { |
45 | 76 | private Manifest mfe1; |
46 | 77 | public MicroFrontend(Manifest mfe1) { |
|
0 commit comments