@seip/blue-bird 0.3.8 → 0.3.9
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.
- package/backend/routes/frontend.js +3 -20
- package/frontend.js +59 -0
- package/package.json +1 -1
|
@@ -3,37 +3,20 @@ import Template from "@seip/blue-bird/core/template.js"
|
|
|
3
3
|
|
|
4
4
|
const routerFrontendExample = new Router();
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
routerFrontendExample.seo([
|
|
7
7
|
{
|
|
8
8
|
path: "/",
|
|
9
9
|
component: "Home",
|
|
10
10
|
meta: { titleMeta: "Home - Blue Bird", descriptionMeta: "Welcome to Blue Bird" },
|
|
11
11
|
props: { id: 1, name: "Name" }
|
|
12
|
-
|
|
13
12
|
},
|
|
14
13
|
{
|
|
15
14
|
path: "/about",
|
|
16
15
|
component: "About",
|
|
17
|
-
meta: { titleMeta: "
|
|
16
|
+
meta: { titleMeta: "Aboutt - Blue Bird", descriptionMeta: "About blue bird", keywordsMeta: "Blue Bird, About Blue Bird" },
|
|
18
17
|
props: { id: 2, name: "Name 2" }
|
|
19
18
|
},
|
|
20
|
-
|
|
21
|
-
];
|
|
22
|
-
routesFrontend.forEach(route_ => {
|
|
23
|
-
routerFrontendExample.get(route_.path, (req, res) => {
|
|
24
|
-
const dynamicProps = {
|
|
25
|
-
props: {
|
|
26
|
-
params: req.params,
|
|
27
|
-
query: req.query,
|
|
28
|
-
...route_.props ?? {}
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
return Template.renderReact(res, route_.component, dynamicProps, {
|
|
33
|
-
metaTags: route_.meta,
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
});
|
|
19
|
+
])
|
|
37
20
|
|
|
38
21
|
|
|
39
22
|
routerFrontendExample.get("*", (req, res) => {
|
package/frontend.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import Router from "@seip/blue-bird/core/router.js"
|
|
2
|
+
import Template from "@seip/blue-bird/core/template.js"
|
|
3
|
+
|
|
4
|
+
const routerFrontendExample = new Router();
|
|
5
|
+
|
|
6
|
+
// const routesFrontend = [
|
|
7
|
+
// {
|
|
8
|
+
// path: "/",
|
|
9
|
+
// component: "Home",
|
|
10
|
+
// meta: { titleMeta: "Home - Blue Bird", descriptionMeta: "Welcome to Blue Bird" },
|
|
11
|
+
// props: { id: 1, name: "Name" }
|
|
12
|
+
|
|
13
|
+
// },
|
|
14
|
+
// {
|
|
15
|
+
// path: "/about",
|
|
16
|
+
// component: "About",
|
|
17
|
+
// meta: { titleMeta: "About - Blue Bird", descriptionMeta: "About blue bird" },
|
|
18
|
+
// props: { id: 2, name: "Name 2" }
|
|
19
|
+
// },
|
|
20
|
+
|
|
21
|
+
// ];
|
|
22
|
+
// routesFrontend.forEach(route_ => {
|
|
23
|
+
// routerFrontendExample.get(route_.path, (req, res) => {
|
|
24
|
+
// const dynamicProps = {
|
|
25
|
+
// props: {
|
|
26
|
+
// params: req.params,
|
|
27
|
+
// query: req.query,
|
|
28
|
+
// ...route_.props ?? {}
|
|
29
|
+
// }
|
|
30
|
+
// };
|
|
31
|
+
|
|
32
|
+
// return Template.renderReact(res, route_.component, dynamicProps, {
|
|
33
|
+
// metaTags: route_.meta,
|
|
34
|
+
// });
|
|
35
|
+
// });
|
|
36
|
+
// });
|
|
37
|
+
|
|
38
|
+
routerFrontendExample.seo([
|
|
39
|
+
{
|
|
40
|
+
path: "/",
|
|
41
|
+
component: "Home",
|
|
42
|
+
meta: { titleMeta: "Home - Blue Bird", descriptionMeta: "Welcome to Blue Bird" },
|
|
43
|
+
props: { id: 1, name: "Name" }
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
path: "/about",
|
|
47
|
+
component: "About",
|
|
48
|
+
meta: { titleMeta: "About - Blue Bird", descriptionMeta: "About blue bird" },
|
|
49
|
+
props: { id: 2, name: "Name 2" }
|
|
50
|
+
},
|
|
51
|
+
])
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
routerFrontendExample.get("*", (req, res) => {
|
|
55
|
+
const response = Template.renderReact(res, "App");
|
|
56
|
+
return response;
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
export default routerFrontendExample;
|