mirror of
https://github.com/donlon/cloudflare-error-page.git
synced 2025-12-19 14:59:28 +00:00
doc(readme): add demo link for examples
This commit is contained in:
78
README.md
78
README.md
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## What does this project do?
|
## What does this project do?
|
||||||
|
|
||||||
This project creates customized error pages that mimics the well-known Cloudflare's error page. You can also embed it into your website.
|
This project creates customized error pages that mimics the well-known Cloudflare error page. You can also embed it into your website.
|
||||||
|
|
||||||
## Quickstart
|
## Quickstart
|
||||||
|
|
||||||
@@ -48,37 +48,41 @@ with open('error.html', 'w') as f:
|
|||||||
webbrowser.open('error.html')
|
webbrowser.open('error.html')
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can also see this example [here](https://virt.moe/cloudflare-error-page/examples/default).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## More Examples
|
## More Examples
|
||||||
|
|
||||||
### Catastrophic infrastructure failure
|
### Catastrophic infrastructure failure
|
||||||
|
|
||||||
``` Python
|
See this example [here](https://virt.moe/cloudflare-error-page/examples/catastrophic).
|
||||||
params = {
|
|
||||||
'title': 'Catastrophic infrastructure failure',
|
``` JavaScript
|
||||||
'more_information': {
|
params = {
|
||||||
|
"title": "Catastrophic infrastructure failure",
|
||||||
|
"more_information": {
|
||||||
"text": "cloudflare.com",
|
"text": "cloudflare.com",
|
||||||
"link": "https://youtube.com/watch?v=dQw4w9WgXcQ",
|
"link": "https://youtube.com/watch?v=dQw4w9WgXcQ",
|
||||||
},
|
},
|
||||||
'browser_status': {
|
"browser_status": {
|
||||||
'status': 'error',
|
"status": "error",
|
||||||
'status_text': 'Out of Memory',
|
"status_text": "Out of Memory",
|
||||||
},
|
},
|
||||||
'cloudflare_status': {
|
"cloudflare_status": {
|
||||||
'status': 'error',
|
"status": "error",
|
||||||
'location': 'Everywhere',
|
"location": "Everywhere",
|
||||||
'status_text': 'Not Working',
|
"status_text": "Not Working",
|
||||||
},
|
},
|
||||||
'host_status': {
|
"host_status": {
|
||||||
'status': 'error',
|
"status": "error",
|
||||||
'location': 'example.com',
|
"location": "example.com",
|
||||||
'status_text': 'On Fire',
|
"status_text": "On Fire",
|
||||||
},
|
},
|
||||||
'error_source': 'cloudflare',
|
"error_source": "cloudflare",
|
||||||
'what_happened': '<p>There is a catastrophic failure.</p>',
|
"what_happened": "<p>There is a catastrophic failure.</p>",
|
||||||
'what_can_i_do': '<p>Please try again in a few years.</p>',
|
"what_can_i_do": "<p>Please try again in a few years.</p>",
|
||||||
'perf_sec_by': {
|
"perf_sec_by": {
|
||||||
"text": "Cloudflare",
|
"text": "Cloudflare",
|
||||||
"link": "https://youtube.com/watch?v=dQw4w9WgXcQ",
|
"link": "https://youtube.com/watch?v=dQw4w9WgXcQ",
|
||||||
},
|
},
|
||||||
@@ -89,29 +93,31 @@ params = {
|
|||||||
|
|
||||||
### Web server is working
|
### Web server is working
|
||||||
|
|
||||||
``` Python
|
See this example [here](https://virt.moe/cloudflare-error-page/examples/working).
|
||||||
|
|
||||||
|
``` JavaScript
|
||||||
params = {
|
params = {
|
||||||
'title': 'Web server is working',
|
"title": "Web server is working",
|
||||||
'error_code': 200,
|
"error_code": 200,
|
||||||
"more_information": {
|
"more_information": {
|
||||||
"hidden": True,
|
"hidden": True,
|
||||||
},
|
},
|
||||||
'browser_status': {
|
"browser_status": {
|
||||||
'status': 'ok',
|
"status": "ok",
|
||||||
'status_text': 'Seems Working',
|
"status_text": "Seems Working",
|
||||||
},
|
},
|
||||||
'cloudflare_status': {
|
"cloudflare_status": {
|
||||||
'status': 'ok',
|
"status": "ok",
|
||||||
'status_text': 'Often Working',
|
"status_text": "Often Working",
|
||||||
},
|
},
|
||||||
'host_status': {
|
"host_status": {
|
||||||
'status': 'ok',
|
"status": "ok",
|
||||||
'location': 'example.com',
|
"location": "example.com",
|
||||||
'status_text': 'Just Working',
|
"status_text": "Just Working",
|
||||||
},
|
},
|
||||||
'error_source': 'host',
|
"error_source": "host",
|
||||||
'what_happened': '<p>This site is still working. And it looks great.</p>',
|
"what_happened": "<p>This site is still working. And it looks great.</p>",
|
||||||
'what_can_i_do': '<p>Visit the site before it crashes someday.</p>',
|
"what_can_i_do": "<p>Visit the site before it crashes someday.</p>",
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user