{"id":18429444,"url":"https://github.com/bigpipe/500-pagelet","last_synced_at":"2025-04-13T21:44:34.314Z","repository":{"id":25025461,"uuid":"28444887","full_name":"bigpipe/500-pagelet","owner":"bigpipe","description":"Default 500 Pagelet used if anything fails in BigPipe","archived":false,"fork":false,"pushed_at":"2020-10-26T13:42:21.000Z","size":14,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-18T07:22:50.357Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bigpipe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-24T10:01:40.000Z","updated_at":"2020-10-26T13:42:24.000Z","dependencies_parsed_at":"2022-08-23T11:30:58.670Z","dependency_job_id":null,"html_url":"https://github.com/bigpipe/500-pagelet","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigpipe%2F500-pagelet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigpipe%2F500-pagelet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigpipe%2F500-pagelet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bigpipe%2F500-pagelet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bigpipe","download_url":"https://codeload.github.com/bigpipe/500-pagelet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248788868,"owners_count":21161726,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T05:17:11.134Z","updated_at":"2025-04-13T21:44:34.293Z","avatar_url":"https://github.com/bigpipe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 500 Pagelet\n\n[![Version npm][version]](http://browsenpm.org/package/500-pagelet)[![Build Status][build]](https://travis-ci.org/bigpipe/500-pagelet)[![Dependencies][david]](https://david-dm.org/bigpipe/500-pagelet)[![Coverage Status][cover]](https://coveralls.io/r/bigpipe/500-pagelet?branch=master)\n\n[version]: http://img.shields.io/npm/v/500-pagelet.svg?style=flat-square\n[build]: http://img.shields.io/travis/bigpipe/500-pagelet/master.svg?style=flat-square\n[david]: https://img.shields.io/david/bigpipe/500-pagelet.svg?style=flat-square\n[cover]: http://img.shields.io/coveralls/bigpipe/500-pagelet/master.svg?style=flat-square\n\nThis Pagelet is responsible for displaying server errors. By\ndefault the 500 Pagelet is provided with BigPipe. However, if you\nneed a custom 500 you can extend this Pagelet. For example to change\nthe default view.\n\n## Installation\n\nThe 500 Pagelet is distributed through the node package manager (npm).\n\n```\nnpm install --save 500-pagelet\n```\n\n## Support\n\nCreate an issue. Every question you have is a bug in our\ndocumentation and that should be corrected. So please, don't hesitate to create\nissues, many of them.\n\n### Example\n\nIn this example the 500 Pagelet is extended with a custom view.\nBigPipe will automatically discover this extended version\nif it is provided to BigPipe alongside the other pagelets.\nNote that the enviroment variable can be overruled to manage the\ndata that is displayed.\n\n```js\n'use strict';\n\n//\n// Extend the 500 Pagelet with a custom view.\n//\nvar Fivehundred = require('500-pagelet').extend({\n  view: '/path/to/my/custom-view.html',  // your custom layout\n  env: 'development'                     // defaults to process.env.NODE_ENV\n});\n\n//\n// Initialise BigPipe server.\n//\nvar pipe = require('bigpipe').createServer(2000, {\n  pagelets: [ Fivehundred, ... ]\n});\n```\n\n### API\n\nThe following methods are available on the 500 Pagelet instance. Most are\nonly used internally. There is rarely a reason to call these methods.\n\n#### new Fivehundred()\n\n**public**, _returns Pagelet_.\n\nThe 500 constructor expects several options to be provided, these\ninclude: `req`, `res` and `pipe`. The last option is a reference\nto the [BigPipe] instance, mainly to ensure the same [Temper]\ninstance is re-used. All code examples assume your file is setup as:\n\n```js\n'use strict';\n\nvar Fivehundred = require('500-pagelet');\n  , fivehundred = new Fivehundred({ options }, new Error('failure'));\n```\n\n#### Bootstrap.get()\n\n**private**, _returns Pagelet_.\n\nExtracts the data from the provided Error to render the template.\nIf the environment is _production_ the `Error.stack` will not be\nprovided to the template.\n\n```js\nfivehundred.get(function render(error, data) {\n  // provide data to pagelet.render\n});\n```\n\n## Debugging\n\nThe library makes use the `diagnostics` module from Pagelet.\nTo display the 500 Pagelet specific debug messages, supply the\nfollowing before running the program or\n\n```bash\nDEBUG=pagelet:500 node ...\n```\n\n## Testing\n\nTests are automatically run on [Travis CI] to ensure that everything is\nfunctioning as intended. For local development we automatically install a\n[pre-commit] hook that runs the `npm test` command every time you commit changes.\nThis ensures that we don't push any broken code in to this project.\n\nTo run tests locally, make sure the development dependencies are installed.\n\n```bash\nnpm test\nnpm run coverage\n```\n\n## License\n\n500-pagelet is released under MIT.\n\n[Travis CI]: http://travisci.org\n[Temper]: http://github.com/bigpipe/temper\n[pre-commit]: http://github.com/observing/pre-commit\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigpipe%2F500-pagelet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbigpipe%2F500-pagelet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbigpipe%2F500-pagelet/lists"}