31 |
32 |
Service health:
33 |
34 | {available ? 'Available' : 'Not available'}
35 |
36 |
37 |
38 |
41 |
42 |
43 |
44 | Made with ❤️ by{' '}
45 |
46 | Webscope.io
47 |
48 |
49 |
50 | );
51 | }
52 |
--------------------------------------------------------------------------------
/examples/basic/static/styles.scss:
--------------------------------------------------------------------------------
1 | @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
2 |
3 | body,
4 | html {
5 | margin: 0;
6 | padding: 0;
7 | background-color: #fafafa;
8 | font-family: 'Roboto', sans-serif;
9 | }
10 |
11 | .container {
12 | display: flex;
13 | flex-direction: column;
14 | align-items: center;
15 | justify-content: center;
16 | width: 100%;
17 | height: 100vh;
18 | }
19 |
20 | .health-wrapper {
21 | display: flex;
22 | flex-direction: column;
23 | align-items: center;
24 | justify-content: center;
25 | margin-bottom: 2rem;
26 |
27 | .availability {
28 | font-size: 2rem;
29 | font-weight: bold;
30 | color: red;
31 |
32 | &.is-available {
33 | color: green;
34 | }
35 | }
36 | }
37 |
38 | p {
39 | margin: 0 0 0.5rem;
40 | }
41 |
42 | .author {
43 | margin-top: 5rem;
44 | }
45 |
--------------------------------------------------------------------------------
/examples/global-conf/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # next.js
12 | /.next/
13 | /out/
14 |
15 | # production
16 | /build
17 |
18 | # misc
19 | .DS_Store
20 | *.pem
21 |
22 | # debug
23 | npm-debug.log*
24 | yarn-debug.log*
25 | yarn-error.log*
26 |
27 | # local env files
28 | .env.local
29 | .env.development.local
30 | .env.test.local
31 | .env.production.local
32 |
33 | # vercel
34 | .vercel
35 |
--------------------------------------------------------------------------------
/examples/global-conf/README.md:
--------------------------------------------------------------------------------
1 | # Example - Global configuration
2 |
3 | This example demonstrates the use of `@webscopeio/react-health-check` package with global configuration.
4 |
5 | ## Deploy with Vercel
6 |
7 | You can deploy this example with one click on Vercel:
8 |
9 | [](https://vercel.com/new/git/external?repository-url=https%3A%2F%2Fgithub.com%2Fwebscopeio%2Freact-health-check%2Ftree%2Fmaster%2Fexamples%2Fglobal-conf&demo-title=Example%20-%20Global%20configuration&demo-description=This%20example%20demonstrates%20the%20use%20of%20%40webscopeio%2Freact-health-check%20package%20with%20global%20configuration.)
10 |
11 | ## Run it locally
12 |
13 | This example is running on Next.js. To run it locally you need to instal all dependencies and start development server.
14 |
15 | ```
16 | npm install
17 | npm run dev
18 | ```
19 |
--------------------------------------------------------------------------------
/examples/global-conf/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "global-conf",
3 | "version": "0.1.0",
4 | "private": true,
5 | "scripts": {
6 | "dev": "next dev",
7 | "build": "next build",
8 | "start": "next start"
9 | },
10 | "dependencies": {
11 | "@webscopeio/react-health-check": "~2.1.6",
12 | "next": "~9.5.3",
13 | "react": "~16.13.1",
14 | "react-dom": "~16.13.1",
15 | "react-toastify": "~6.0.8",
16 | "sass": "~1.26.10"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/examples/global-conf/pages/_app.jsx:
--------------------------------------------------------------------------------
1 | import { ToastContainer } from 'react-toastify';
2 | import { HealthCheckConfig } from '@webscopeio/react-health-check';
3 | import { toast } from 'react-toastify';
4 |
5 | import 'react-toastify/dist/ReactToastify.css';
6 | import '../static/styles.scss';
7 |
8 | function MyApp({ Component, pageProps }) {
9 | return (
10 |