profile
viewpoint

emotion-js/facepaint 506

Responsive style values for css-in-js.

kpdecker/border-image-generator 90

WYSIWYG editor for border-image styles

kpdecker/ALCE 4

Human friendly, machine editable, JSON-like config file format.

kpdecker/amo-version-reduce 3

Simple utility that reduces the detailed host application version statistics

kpdecker/benchmark.js 2

The JSLitmus-based benchmarking script as used on jsperf.com

healthline/static-assets 1

PUBLIC REPOSITORY. YOU HAVE BEEN WARNED.

kpdecker/carahue 1

Declarative style diffing tool

kpdecker/cheerio 1

Fast, flexible, and lean implementation of core jQuery designed specifically for the server.

issue commenthapijs/h2o2

Pass `h` or similar to `mapUri` and `onRequest` for server settings/configuration access

I took a look at the codebase and you're right, it seems that the request.server object is not truly read-only. Does it mean the documentation is just to stir people away from modifying request.server.app from their handler or other method accessing the request object without technically enforcing it?

brianjmiller

comment created time in 2 hours

issue commenthapijs/h2o2

Pass `h` or similar to `mapUri` and `onRequest` for server settings/configuration access

I based my explanation on the documentation on the website: https://hapi.dev/api/?v=20.0.3#-requestserver. Is it the server object itself that is read-only but the property app is not or just an error in the documentation?

brianjmiller

comment created time in 2 hours

startedkpdecker/jsdiff

started time in 3 hours

startedkpdecker/jsdiff

started time in 8 hours

startedkpdecker/jsdiff

started time in 12 hours

startedkpdecker/jsdiff

started time in 18 hours

startedkpdecker/jsdiff

started time in 18 hours

startedkpdecker/six-speed

started time in 20 hours

MemberEvent

issue commenthapijs/h2o2

Pass `h` or similar to `mapUri` and `onRequest` for server settings/configuration access

request.server.app is read/write as well, but you can't use it to store request-specific state.

brianjmiller

comment created time in a day

startedRCasatta/firma

started time in a day

issue commentsideway/joi-date

Documentation missing

Joi is not part of the hapi ecosystem anymore. You'll find the joi-date documentation here: https://joi.dev/module/joi-date/.

doktormerlin

comment created time in a day

issue commenthapijs/h2o2

Pass `h` or similar to `mapUri` and `onRequest` for server settings/configuration access

You're welcome. I'm glad I could help you.

I'm able to pull the config from request.server.app that I need in mapUri

Be aware that request.server.app is read-only whereas request.app is read/write: https://hapi.dev/api/?v=20.0.3#-requestapp

brianjmiller

comment created time in a day

startedpreactjs/wmr

started time in a day

issue closedhapijs/h2o2

Pass `h` or similar to `mapUri` and `onRequest` for server settings/configuration access

<!-- ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ You must complete this entire issue template to receive support. You MUST NOT remove, change, or replace the template with your own format. A missing or incomplete report will cause your issue to be closed without comment. Please respect the time and experience that went into this template. It is here for a reason. Thank you! ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ -->

Support plan

<!-- We are here to help!

Community based support is, by its nature, limited to available community members able to help. Most community support issues are resolved within 2 weeks. Before submitting an issue, please review the various support options available at https://hapi.dev/support/. That page includes useful information about different ways to ask questions. -->

  • is this issue currently blocking your project? (yes/no): yes
  • is this issue affecting a production system? (yes/no): no

Context

  • node version: v14.15.1
  • module version: 9.0.2
  • environment (e.g. node, browser, native): node
  • used with (e.g. hapi application, another framework, standalone, ...): hapi application
  • any other relevant information:

What problem are you trying to solve?

<!-- Describe your issue in detail, including use cases, examples, and alternative solutions you have already tried. Make sure to wrap all code examples in backticks so that they display correctly. Before submitting an issue, make sure to click on the Preview tab above to verify everything is formatted correctly. -->

I would like to be able to store configurable values such as "host", "port", "path", etc. within the Hapi server configuration and then be able to leverage them from within the mapUri and onRequest functions. These two functions are called within the handler for the route and it appears straightforward to pass the h through to them. They currently receive the Wreck request which AFAICT doesn't provide a reference to the app level configuration.

I'm open to better solutions of how to provide configurable values to these handlers, whether that is through the plugin interface or some such. Obviously I can work around it by using a singleton or similar at the global level but I'd rather pass them through the Hapi server in some way as that is my understanding of the proper way to do things of this nature in Hapi.

Do you have a new or modified API suggestion to solve the problem?

It seems sufficient to pass h as the second argument in the call on https://github.com/hapijs/h2o2/blob/master/lib/index.js#L94 and https://github.com/hapijs/h2o2/blob/master/lib/index.js#L167

closed time in 2 days

brianjmiller

issue commenthapijs/h2o2

Pass `h` or similar to `mapUri` and `onRequest` for server settings/configuration access

Thanks for the response. I'm not sure why I conflated the request to mapUri and to onRequest as both being Wreck requests. Your comment helped me to understand the overall flow better. I also don't know why my output for trying to see the values from request.app didn't work as trying again this morning I'm able to pull the config from request.server.app that I need in mapUri.

I think ultimately my need for the values in onRequest is better fulfilled by using a pre lifecycle method, I just wasn't thinking about the overall event flow correctly. IOW shifting the work to before the proxy is even considered is a better route than after the new proxy request is created.

Sorry, for the noise, but I do appreciate your help, thanks!

brianjmiller

comment created time in 2 days

issue openedsideway/joi-date

Documentation missing

<!-- ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ You must complete this entire issue template to receive support. You MUST NOT remove, change, or replace the template with your own format. A missing or incomplete report will cause your issue to be closed without comment. Please respect the time and experience that went into this template. It is here for a reason. Thank you! ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ -->

Context

  • node version: All
  • module version: All

What are you trying to achieve or the steps to reproduce ?

The documentation on the hapi site is missing. If you click on the documentation link, it leads to a 404. See for yourself: https://hapi.dev/family/joi-date/

<!-- Before opening a documentation issue, please consider opening a Pull Request instead for trivial changes such as typos, spelling, incorrect links, anchors, or other corrections that are easier to just fix than report using this template.

Please do not spend valuable time proposing extensive changes to the documentation before first asking about it. We value your time and do not want to waste it. Just open an issue first using this template and ask if your proposed changes would be helpful.

Make sure to wrap all code examples in backticks so that they display correctly. Before submitting an issue, make sure to click on the Preview tab above to verify everything is formatted correctly. -->

created time in 2 days

startedkpdecker/jsdiff

started time in 2 days

startedkpdecker/jsdiff

started time in 2 days

startedOisinMoran/quinetweet

started time in 3 days

startedkpdecker/jsdiff

started time in 3 days

created repositorybrianleroux/arc-example-deno-ssr-slack-oauth

created time in 3 days

starteddavidmarkclements/v8-perf

started time in 3 days

startedkpdecker/jsdiff

started time in 3 days

startedlukeed/clsx

started time in 4 days

startedkpdecker/jsdiff

started time in 4 days

startedkpdecker/jsdiff

started time in 4 days

startedkpdecker/jsdiff

started time in 4 days

startedmrdoob/stats.js

started time in 4 days

more