Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    ImranDoet
    @ImranDoet
    and yes
    Tõnis Ostrat
    @tonisostrat
    so you're basically going to re-implement a percentage of the core API?
    ImranDoet
    @ImranDoet
    Yes
    Into a REST API
    We also want to stand off from the core api
    Yoann MALLEMANCHE
    @YoannMa
    https://futurestud.io/tutorials/hapi-get-your-server-up-and-running You could check this website, there are some tutorial about authentication with Hapi and scope for access restriction
    ImranDoet
    @ImranDoet
    Yeah
    I saw it
    Yoann MALLEMANCHE
    @YoannMa
    I see
    ImranDoet
    @ImranDoet
    I'm going to end up having to make a custom authentication
    Tõnis Ostrat
    @tonisostrat
    doesn't the existing core have a rule/role system where you can segregate certain users (in this case your developers) so they can't hammer random endpoints but only the ones you deem accessible (the playerdata related stuff)?
    ImranDoet
    @ImranDoet
    Nope
    That's why I said the we want to get rid of the core
    Tõnis Ostrat
    @tonisostrat
    ah, gotcha. i misunderstood the "stand off" part.
    ImranDoet
    @ImranDoet
    Sorry, not a native speaker
    Tõnis Ostrat
    @tonisostrat
    honestly, it sounds more like the core is rotten already and you're just making a bandaid.
    ImranDoet
    @ImranDoet
    Yep
    Thats true
    Also
    How do I change my profile picture here
    I don't know how I got this one honestly
    Yoann MALLEMANCHE
    @YoannMa
    from github I think
    Tõnis Ostrat
    @tonisostrat
    it's the github one, yeah
    thomas159
    @thomas159
    Hey, Im having some trouble getting hapi to work on heroku - any ideas? https://stackoverflow.com/questions/53692065/deploy-hapi-api-on-heroku
    devin ivy
    @devinivy
    @thomas159 when you create your server (new Hapi.Server()), try setting host to 0.0.0.0.
    j0shua
    @j0shua
    Hi, is it possible to change a route after it's been mounted? I have a plugin that's going to mount a route and I'd like to turn off auth via auth:false after the plugin has been registered is this possible?
    i mean that i'd like to change the config on a route
    devin ivy
    @devinivy
    @j0shua once you've defined a route there's no reliable way to alter its configuration. there is probably an alternate way to achieve what you're trying to do though.
    j0shua
    @j0shua
    thanks @devinivy, btw ur code on github was very helpful to me when i was getting started with hapi, so THANK YOU
    devin ivy
    @devinivy
    cheers, @j0shua !
    Tõnis Ostrat
    @tonisostrat
    what about server.table()? i'm using the resulting list there to modify the response object in options and it seems to work. i know the doc states it returns a "copy of the routing table" but the modifications my plugins make work.
    devin ivy
    @devinivy
    as you can imagine it's not recommended :P
    Tõnis Ostrat
    @tonisostrat
    except that it's never stated anywhere in the doc that modifying the routes that way is not recommended nor are the reasons explained or even listed.
    JaseElder
    @JaseElder
    Hiya, is there any supported way to ingest XML in a hapi rest service? I tried hooking into onPostAuth, but that looks like it's after not only authentication, but also trying to parse the payload - when it's XML I get a 415 error.
    Ideally I want to authenticate, then convert the payload to JSON using xml2js or xml2obj-stream or somesuch, but it doesn't look like I have a hook into the gap between authentication and payload parsing
    cwatsonc
    @cwatsonc
    Seeking guidance on server.register( )
    cwatsonc
    @cwatsonc
    also how does one join the #slack channel workspace?
    Tõnis Ostrat
    @tonisostrat
    @cwatsonc, describe your actual problem
    cwatsonc
    @cwatsonc
    @YoannMa the link is no longer valid
    Yoann MALLEMANCHE
    @YoannMa
    thanks, I'll notify the admin of the slack
    cwatsonc
    @cwatsonc
    I am trying to get to a plugin based implementation and am struggling with the server.register() and server.dependency() methods. I am relatively new to Node.js and to Hapi.js as a framework. As I read the API documentation the server.register(array) should register the enumerated plugins in the order of the array. server.dependency(pluginNamesArray) should ensure that the plugin that expresses the dependency is ensured those dependencies have completed registry before the "self" registration attempt. My current strategy attempt fails on the server being started before the plugin registration completes.
    Dan Kelly
    @dankell
    Moving over to Hapi 17 / Hapi-mysql-2 our database instances are now accessed via req.server.mysql.pool[x] (or req.server.plugins.db.name). Is there a simple way to access these at the point that a route handler module is registered? We have a couple of routes that immediately access the database on registration
    Ben Chiciudean
    @benydc
    hello, I'm new to hapi
    if I have repose.validation with Joi Schema, do I need to return a plain object, can I not just return a mongo document?
    Yoann MALLEMANCHE
    @YoannMa
    @benydc Welcome, you should set response.validation as a Joi.object() and that should work
    Stuart
    @Rushmead
    Hi! Is there a way I can set a middleware / pre check on every route on my app?
    Yoann MALLEMANCHE
    @YoannMa