Skip to content

Commit 6e46bc5

Browse files
committed
Update
1 parent 75534a0 commit 6e46bc5

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

source/apps/hcm/package.d

+20-9
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ module apps.hcm;
22

33
mixin(ImportPhobos!());
44

5-
// Dub
6-
public import vibe.d;
5+
// External
6+
public {
7+
import vibe.d;
8+
}
79

810
// UIM
911
public import uim.core;
@@ -26,12 +28,21 @@ public {
2628
}
2729

2830
static this() {
29-
AppRegistry.register("apps.hcm",
30-
App("hcmApp", "apps/hcm")
31-
.importTranslations()
32-
.addRoutes(
33-
Route("", HTTPMethod.GET, IndexPageController),
34-
Route("/", HTTPMethod.GET, IndexPageController)
35-
)
31+
// Create app
32+
auto myApp = App("hcmApp", "apps/hcm");
33+
34+
// Customize app
35+
with(myApp) {
36+
importTranslations;
37+
addControllers([
38+
"hcm.index": IndexPageController
39+
]);
40+
addRoutes(
41+
Route("", HTTPMethod.GET, controller("hcm.index")),
42+
Route("/", HTTPMethod.GET, controller("hcm.index"))
3643
);
44+
}
45+
46+
// register app
47+
AppRegistry.register("apps.hcm", myApp);
3748
}

0 commit comments

Comments
 (0)