GithubHelp home page GithubHelp logo

httperrorpages / httperrorpages Goto Github PK

View Code? Open in Web Editor NEW
934.0 23.0 200.0 575 KB

:fast_forward: Simple HTTP Error Page Generator

Home Page: https://httperrorpages.github.io/HttpErrorPages/HTTP500.html

License: MIT License

CSS 34.49% JavaScript 57.61% Shell 0.19% SCSS 5.02% EJS 2.70%
lighttpd nginx html apache-httpd error-messages error-handling theme caddy koajs expressjs

httperrorpages's People

Contributors

andidittrich avatar antunesleo avatar boris1993 avatar charanrajtc avatar gablau avatar iworks avatar klodr avatar ks7000 avatar lucas-luchack avatar webysther avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

httperrorpages's Issues

Ubuntu Server 16.04.3 error on npm install

Hi,
I have an error when launch npm install on the /opt/HttpErrorPages/ directory.

Paste the log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'install' ]
2 info using [email protected]
3 info using [email protected]
...
10562 silly rollbackFailedOptional Finishing
10563 silly runTopLevelLifecycles Starting
10564 silly runTopLevelLifecycles Finishing
10565 silly install printInstalled
10566 verbose stack Error: [email protected] install: node scripts/install.js
10566 verbose stack spawn ENOENT
10566 verbose stack at ChildProcess. (/usr/share/npm/lib/utils/spawn.js:17:16)
10566 verbose stack at emitTwo (events.js:87:13)
10566 verbose stack at ChildProcess.emit (events.js:172:7)
10566 verbose stack at maybeClose (internal/child_process.js:821:16)
10566 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
10567 verbose pkgid [email protected]
10568 verbose cwd /opt/HttpErrorPages
10569 error Linux 4.4.0-101-generic
10570 error argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
10571 error node v4.2.6
10572 error npm v3.5.2
10573 error file sh
10574 error code ELIFECYCLE
10575 error errno ENOENT
10576 error syscall spawn
10577 error [email protected] install: node scripts/install.js
10577 error spawn ENOENT
10578 error Failed at the [email protected] install script 'node scripts/install.js'.
10578 error Make sure you have the latest version of node.js and npm installed.
10578 error If you do, this is most likely a problem with the node-sass package,
10578 error not with npm itself.
10578 error Tell the author that this fails on your system:
10578 error node scripts/install.js
10578 error You can get information on how to open an issue for this project with:
10578 error npm bugs node-sass
10578 error Or if that isn't available, you can get their info via:
10578 error npm owner ls node-sass
10578 error There is likely additional logging output above.
10579 verbose exit [ 1, true ]

Whats the problem??

Version 3.1.0?

Version 3.1.0 is working out well for me. Do you know when you will be publishing the version to npm?

Start a crowdsourcing translate project maybe?

Would you consider starting a crowdsourcing translation project on such platforms like Transifex or Conyac?
People from all over the world can contribute their translation and make corrections on others'.
Also, you can get the most accurate translation into different languages.

Add option to pass additional parameters to the template

It would be nice to have an option to add a method that wraps the data passed to the page-renderer, providing the req. Something to the effect of:

const errorDataHandler = (data, req) => {
    data.body = req.body
    data.redirectTo = req.host
}
 await httpErrorPages.express(this.app, {
            errorDataHandler,
            lang: 'en_US',
            footer: `hello <strong>world</strong>`,
        })

I can include changes to express.js to demonstrate how I think this could work and provide that in a PR to be examined alongside this issue.

Add support for using res.locals in template file

Thanks again for this package, @AndiDittrich.

I am currently working my way through CSP errors on all of my page templates and the last stop is the http-error-pages template. To overcome the CSP limitations with inline resources, I need to be able to insert a nonce where scripts and styles are inlined. In res.locals, at the beginning of each request, I create and assign the nonce value. If I had access to the response object in the opt.filter method, for example, I could add the nonce value there to be used in the template.

Alternatively, if I could set my own render method, I have my own ejs (and other) renderer(s) that ensure nonces are present on the correct tags. I am going to fork this repo once again and I can create a PR if/when I have something to present.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.