You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 13, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+39-6Lines changed: 39 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,33 @@
3
3
This is the mfe-core [single-spa](https://single-spa.js.org/) application which loads all other Topcoder micro-frontend (MFE) applications.
4
4
It always loads the **Topcoder Header Microapp** which provides the top-level navigation, handles authorization, and loads other microapps depending on the current URL.
5
5
6
+
## Content
7
+
8
+
Following are the list of sections defined in this document,
9
+
10
+
-[Overview](#overview)
11
+
-[Requirements](#requirements)
12
+
-[Local Development Setup](#local-development-setup)
@@ -140,7 +167,9 @@ This `mfe-core` app has 2 types of configs:
140
167
| `npm run format` | Format code using prettier |
141
168
| `npm run test` | Run unit tests |
142
169
143
-
## Local Deployment from multi web servers (nodemon & webpack-dev-server) for local development - (most common)
170
+
## Local Deployment
171
+
172
+
### Local Deployment from multi web servers (nodemon & webpack-dev-server) for local development - (most common)
144
173
145
174
To run the `mfe-core` app locally, run the following commands from the project root `./mfe-core`:
146
175
@@ -154,7 +183,7 @@ Terminal 2
154
183
$ npm run start-client
155
184
```
156
185
157
-
## Local Deployment from web server (node)
186
+
### Local Deployment from web server (node)
158
187
159
188
To deploy `mfe-core` app locally run inside the project root `./mfe-core`:
160
189
@@ -169,7 +198,9 @@ To deploy `mfe-core` app locally run inside the project root `./mfe-core`:
169
198
170
199
⚠️ **NOTE** : that to make authorization work locally, you have to use domain `local.topcoder-dev.com` with port `3000`. On your local machine access file `/etc/hosts` add the line `127.0.0.1 local.topcoder-dev.com` and open app by URL http://local.topcoder-dev.com:3000
171
200
172
-
## Deployment to Development from web server (node) port 80
201
+
## Deployment to Development
202
+
203
+
### Deployment to Development from web server (node) port 80
173
204
174
205
| Command | Description |
175
206
| -------------------- | ---------------------- |
@@ -180,7 +211,9 @@ To deploy `mfe-core` app locally run inside the project root `./mfe-core`:
180
211
| `$ npm start` | to start the app on port `80`, served from `dist/` |
181
212
| `https://mfe.topcoder-dev.com/micro-frontends-react-route` | open url in browser to access the micro frame with react micro app and micro navbar app |
182
213
183
-
## Deployment to Production from web server (node) port 80
214
+
## Deployment to Production
215
+
216
+
### Deployment to Production from web server (node) port 80
184
217
185
218
| Command | Description |
186
219
| -------------------- | ---------------------- |
@@ -191,7 +224,7 @@ To deploy `mfe-core` app locally run inside the project root `./mfe-core`:
191
224
| `$ npm start` | to start the app on port `80`, served from `dist/` |
192
225
| `https://mfe.topcoder.com/micro-frontends-react-route` | open url in browser to access the micro frame with react micro app and micro navbar app |
193
226
194
-
### Deploying to Heroku
227
+
#### Deploying to Heroku
195
228
196
229
Make sure you have [Heroky CLI](https://devcenter.heroku.com/articles/heroku-cli) installed and you have a Heroku account. And then inside the project folder run the next commands:
197
230
@@ -221,7 +254,7 @@ Because analytics can be normally initialized once per website, we are initializ
221
254
- We can enable debug mode by calling `analytics.debug();` inside browser console, see [debug documentation](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#debug).
222
255
- TODO: we might consider implementing one global logic for calling `window.analytics.page()` inside Frame of Navbar app so child apps wouldn't worry about this. Though we have to make sure that it works smoothly. In particular we have to make sure that if child app updates page `<title>` then `window.analytics.page()` is called after that and logs to the analytic correct page title. Also, child apps might want to provide additional arguments when calling `window.analytics.page()`. So we might come to this improvement in some time, after we try the current approach.
223
256
224
-
## Add/Remove child app
257
+
## Add or Remove child app
225
258
226
259
For adding a child app to the root app make the following steps:
0 commit comments