Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add health endpoint #1067

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/components/HealthCheck.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';

const HealthCheck = () => {
return (
<div>
<pre>{JSON.stringify({foo: "bar"})}</pre>
</div>
);
};

export default HealthCheck;
43 changes: 24 additions & 19 deletions src/components/RehydrationProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import {
ROUTE_STATUS,
ROUTE_GETINVOLED,
ROUTE_CHARTER,
ROUTE_FILE
ROUTE_FILE,
ROUTE_HEALTH
} from '../utils/routingConstants'
import history from '../config/history'
import { configureStore } from '../configureStore'
Expand All @@ -37,6 +38,7 @@ import PageFile from './Navigation/Pages/PageFile'
import PageHarvest from './Navigation/Pages/PageHarvest'
import GetInvolved from './GetInvolved'
import Charter from './Charter'
import HealthCheck from './HealthCheck'

const store = configureStore()

Expand Down Expand Up @@ -83,24 +85,27 @@ export default class RehydrationDelayedProvider extends Component {
return (
<Provider store={store} history={history}>
<Router>
<App className="App">
<Switch>
<Route path={ROUTE_WORKSPACE} component={withTracker(PageDefinitions)} />
<Route path={ROUTE_DEFINITIONS} exact={true} component={() => (window.location = ROUTE_WORKSPACE)} />
<Route path={ROUTE_DEFINITIONS} component={withTracker(FullDetailPage)} />
<Route path={ROUTE_SHARE} component={withTracker(PageDefinitions)} />
<Route path={ROUTE_CURATIONS} component={withTracker(PageContribution)} />
<Route path={ROUTE_HARVEST} component={withTracker(PageHarvest)} />
<Route path={ROUTE_ABOUT} component={withTracker(PageAbout)} />
<Route path={ROUTE_GETINVOLED} component={withTracker(GetInvolved)} />
<Route path={ROUTE_CHARTER} component={withTracker(Charter)} />
<Route path={ROUTE_STATS} component={withTracker(PageStats)} />
<Route path={ROUTE_STATUS} component={withTracker(PageStatus)} />
<Route path={ROUTE_DISCORD} component={() => (window.location = 'https://discord.gg/wEzHJku')} />
<Route path={ROUTE_FILE} component={withTracker(PageFile)} />
<Route path={ROUTE_ROOT} component={withTracker(PageBrowse)} />
</Switch>
</App>
<Switch>
<Route path={ROUTE_HEALTH} component={HealthCheck} />
<App className="App">
<Switch>
<Route path={ROUTE_WORKSPACE} component={withTracker(PageDefinitions)} />
<Route path={ROUTE_DEFINITIONS} exact={true} component={() => (window.location = ROUTE_WORKSPACE)} />
<Route path={ROUTE_DEFINITIONS} component={withTracker(FullDetailPage)} />
<Route path={ROUTE_SHARE} component={withTracker(PageDefinitions)} />
<Route path={ROUTE_CURATIONS} component={withTracker(PageContribution)} />
<Route path={ROUTE_HARVEST} component={withTracker(PageHarvest)} />
<Route path={ROUTE_ABOUT} component={withTracker(PageAbout)} />
<Route path={ROUTE_GETINVOLED} component={withTracker(GetInvolved)} />
<Route path={ROUTE_CHARTER} component={withTracker(Charter)} />
<Route path={ROUTE_STATS} component={withTracker(PageStats)} />
<Route path={ROUTE_STATUS} component={withTracker(PageStatus)} />
<Route path={ROUTE_DISCORD} component={() => (window.location = 'https://discord.gg/wEzHJku')} />
<Route path={ROUTE_FILE} component={withTracker(PageFile)} />
<Route path={ROUTE_ROOT} component={withTracker(PageBrowse)} />
</Switch>
</App>
</Switch>
</Router>
</Provider>
)
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ if (!Array.prototype.includes)
'You need a browser that supports modern JavaScript features to view this site. Please switch to another browser.'
)
ReactDOM.render(< RehydrationProvider />, document.getElementById('root'))
unregister()
unregister()
1 change: 1 addition & 0 deletions src/utils/routingConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ export const ROUTE_STATUS = '/status'
export const ROUTE_GETINVOLED = '/get-involved'
export const ROUTE_CHARTER = '/charter'
export const ROUTE_FILE = '/file'
export const ROUTE_HEALTH = '/health'
export const ROUTE_ROOT = '/'