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

Commit 7e09cf8

Browse files
author
dengjun
committed
ouput from challenge:30188190
1 parent 533d3c9 commit 7e09cf8

20 files changed

+2731
-179
lines changed

.eslintrc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
{
2-
"extends": ["react-important-stuff", "plugin:prettier/recommended"],
3-
"parser": "babel-eslint"
4-
}
2+
"extends": [
3+
"react-important-stuff",
4+
"plugin:prettier/recommended"
5+
],
6+
"parser": "babel-eslint",
7+
"env": {
8+
"node": true
9+
}
10+
}

README.md

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ This is a [single-spa](https://single-spa.js.org/) example React microapp.
1313

1414
## NPM Commands
1515

16-
Command | Description
17-
--------------------- | -----------------------------------------------------------------
18-
`npm start` | Run server which serves production ready build from `dist` folder
19-
`npm run dev` | Run app in the development mode
20-
`npm run dev-https` | Run app in the development mode using HTTPS protocol
21-
`npm run build` | Build app for production and puts files to the `dist` folder
22-
`npm run analyze` | Analyze dependencies sizes and opens report in the browser
23-
`npm run lint` | Check code for lint errors
24-
`npm run format` | Format code using prettier
25-
`npm run test` | Run unit tests
26-
`npm run watch-tests` | Watch for file changes and run unit tests on changes
27-
`npm run coverage` | Generate test code coverage report
16+
| Command | Description |
17+
| --------------------- | ----------------------------------------------------------------- |
18+
| `npm start` | Run server which serves production ready build from `dist` folder |
19+
| `npm run dev` | Run app in the development mode |
20+
| `npm run dev-https` | Run app in the development mode using HTTPS protocol |
21+
| `npm run build` | Build app for production and puts files to the `dist` folder |
22+
| `npm run analyze` | Analyze dependencies sizes and opens report in the browser |
23+
| `npm run lint` | Check code for lint errors |
24+
| `npm run format` | Format code using prettier |
25+
| `npm run test` | Run unit tests |
26+
| `npm run watch-tests` | Watch for file changes and run unit tests on changes |
27+
| `npm run coverage` | Generate test code coverage report |
2828

2929
## Local Deployment
3030

@@ -58,3 +58,20 @@ Make sure you have [Heroky CLI](https://devcenter.heroku.com/articles/heroku-cli
5858

5959
- Now you have to configure frame app to use the URL provided by Heroku like `https://<APP-NAME>.herokuapp.com/earn-app/topcoder-micro-frontends-earn-app.js` to load this microapp.
6060

61+
### Aggregator API
62+
63+
Please refer to [Swagger Doc](./src/api/docs/swagger.yaml) for Aggregator API endpoints
64+
65+
#### Aggregator API Configuration
66+
67+
In the `micro-frontends-earn-app` root directory create `.env` file with the next environment variables.
68+
69+
```bash
70+
# Auth0 config
71+
AUTH_SECRET=
72+
AUTH0_URL=
73+
AUTH0_AUDIENCE=
74+
AUTH0_CLIENT_ID=
75+
AUTH0_CLIENT_SECRET=
76+
```
77+
Once the earn app is started, the aggregator api will work as well

config/default.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require("dotenv").config();
12
module.exports = {
23
GUIKIT: {
34
DEBOUNCE_ON_CHANGE_TIME: 150,
@@ -10,4 +11,29 @@ module.exports = {
1011
BASE: "https://www.topcoder-dev.com",
1112
COMMUNITY_APP: "https://community-app.topcoder-dev.com",
1213
},
14+
// the server api base path
15+
API_BASE_PATH: process.env.API_BASE_PATH || "/api",
16+
// the log level, default is 'debug'
17+
LOG_LEVEL: process.env.LOG_LEVEL || "debug",
18+
// The authorization secret used during token verification.
19+
AUTH_SECRET: process.env.AUTH_SECRET || "mysecret",
20+
// The valid issuer of tokens, a json array contains valid issuer.
21+
VALID_ISSUERS:
22+
process.env.VALID_ISSUERS ||
23+
'["https://api.topcoder-dev.com", "https://api.topcoder.com", "https://topcoder-dev.auth0.com/", "https://auth.topcoder-dev.com/"]',
24+
// Auth0 URL, used to get TC M2M token
25+
AUTH0_URL: process.env.AUTH0_URL,
26+
// Auth0 audience, used to get TC M2M token
27+
AUTH0_AUDIENCE: process.env.AUTH0_AUDIENCE,
28+
// Auth0 client id, used to get TC M2M token
29+
AUTH0_CLIENT_ID: process.env.AUTH0_CLIENT_ID,
30+
// Auth0 client secret, used to get TC M2M token
31+
AUTH0_CLIENT_SECRET: process.env.AUTH0_CLIENT_SECRET,
32+
// Proxy Auth0 URL, used to get TC M2M token
33+
AUTH0_PROXY_SERVER_URL: process.env.AUTH0_PROXY_SERVER_URL,
34+
m2m: {
35+
M2M_AUDIT_USER_ID:
36+
process.env.M2M_AUDIT_USER_ID || "00000000-0000-0000-0000-000000000000",
37+
M2M_AUDIT_HANDLE: process.env.M2M_AUDIT_HANDLE || "TopcoderService",
38+
},
1339
};

0 commit comments

Comments
 (0)