Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit f66517e

Browse files
committed
notifications demo
1 parent e43f952 commit f66517e

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

server.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ app.get('/', function (req, res) {
2222
})
2323

2424
const PORT = process.env.PORT || 8500;
25-
app.listen(PORT);
25+
app.listen(PORT, '0.0.0.0');
2626
console.log(`App is hosted on port ${PORT}.`); // eslint-disable-line no-console

src/constants/appMenu.js

+6
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ const appMenu = [
2525
icon: homeIcon,
2626
activeIcon: homeActiveIcon,
2727
},
28+
{
29+
title: "View All Notifications",
30+
path: "/notifications",
31+
icon: homeIcon,
32+
activeIcon: homeActiveIcon,
33+
}
2834
];
2935

3036
export default appMenu;

src/root.component.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import React, { useEffect } from "react";
22
import { Link, Router } from "@reach/router";
3-
import { setAppMenu } from "@topcoder/micro-frontends-navbar-app";
3+
import {
4+
setAppMenu,
5+
setNotificationPlatform,
6+
PLATFORM,
7+
} from "@topcoder/micro-frontends-navbar-app";
48
import appMenu from "./constants/appMenu";
59
import AuthDemo from "./components/AuthDemo";
610
import NoSidebarDemo from "./components/NoSidebarDemo";
@@ -9,6 +13,7 @@ export default function Root() {
913
useEffect(() => {
1014
// when app starts it should set its side menu structure
1115
setAppMenu("/micro-frontends-react-route", appMenu);
16+
setNotificationPlatform(PLATFORM.CONNECT);
1217
}, []);
1318

1419
return (

webpack.config.js

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const webpackMerge = require("webpack-merge");
44
const singleSpaDefaults = require("webpack-config-single-spa-react");
5+
const path = require('path')
56

67
module.exports = (webpackConfigEnv) => {
78
const defaultConfig = singleSpaDefaults({
@@ -18,6 +19,10 @@ module.exports = (webpackConfigEnv) => {
1819
"@topcoder/micro-frontends-navbar-app":
1920
"@topcoder/micro-frontends-navbar-app",
2021
},
22+
output: {
23+
path: path.resolve(__dirname, 'dist'),
24+
publicPath: 'react',
25+
},
2126
module: {
2227
rules: [
2328
{
@@ -29,5 +34,8 @@ module.exports = (webpackConfigEnv) => {
2934
},
3035
],
3136
},
37+
devServer: {
38+
host: '0.0.0.0'
39+
}
3240
});
3341
};

0 commit comments

Comments
 (0)