Error Pages

Error Views for Client Side Errors

The Error Views: 403, 404, 500 Statuses

Assets

The assets for these error pages are bundled just like the rest of of the pages however they are in their own directories.

These pages are handled separately then any other page that you add.

Status Codes

Each status code is separated by the HTTP request status code number that they are associated to.

  • 403: Forbidden Page
  • 404: Page Not Found
  • 500: Internal Server Error

Add the 403 page and it's render method just like the 404 catch in app.js to show this view anywhere that you would like.

Location of Assets

/* * 403 Status Assets* */ JS File: ./assets/js/errors/403/403.jsJSX File: ./assets/jsx/errors/403/component.jsxCSS File: ./assets/css/errors/403/403.cssSASS File: ./assets/scss/errors/403/403.scssLESS File: ./assets/less/errors/403/403.lessPug File: ./views/errors/403/403.pug/* * 404 Status Assets* */ JS File: ./assets/js/errors/404/404.jsJSX File: ./assets/jsx/errors/404/component.jsxCSS File: ./assets/css/errors/404/404.cssSASS File: ./assets/scss/errors/404/404.scssLESS File: ./assets/less/errors/404/404.lessPug File: ./views/errors/404/404.pug/* * 500 Status Assets* */ JS File: ./assets/js/errors/500/500.jsJSX File: ./assets/jsx/errors/500/component.jsxCSS File: ./assets/css/errors/500/500.cssSASS File: ./assets/scss/errors/500/500.scssLESS File: ./assets/less/errors/500/500.lessPug File: ./views/errors/500/500.pug

Forbidden Page

Add Forbidden View

app.get('/forbidden', (req, res) => { renderError(req, res, 'errors/403', { hashId: makeHash(40), statusCode: 403, environment: process.env.NODE_ENV, title: '403: Forbidden Page' }); });