Created
January 17, 2019 20:13
-
-
Save Lcfvs/53f3a2ee88128c4fb6c7a4e93ff35193 to your computer and use it in GitHub Desktop.
Simple server exception manager, for anticore. Try it with https://github.com/Lcfvs/anticore-default-project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // create this file | |
| import { anticore } from 'anticore' | |
| import { one } from 'anticore/dom/query/one' | |
| import { replace } from 'anticore/dom/tree/replace' | |
| anticore.on('main.exception', function (element, next, loaded) { | |
| loaded && replace(element, one('body > main')) | |
| next() | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // add the following line into your index.js, BEFORE the `anticore.defaults().populate()` | |
| import './exception.md' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- create this file --> | |
| <main class="exception"> | |
| <h1>Page not found</h1> | |
| <a href="">Restart</a> | |
| </main> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- add the following line into your index.html file --> | |
| <a href="./fragments/404.html">Load the 404</a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment