If I have two fields, I'd just like to validate when at least one field is a non empty string, but fail when both fields are empty strings.  Something like this does not validate  var schema = Joi.object().keys({     a: Joi.string(),     b: Joi.s...
This question already has an answer here:...
I have this piece of code in my socketio file and here I can use socket simply.  import _ from 'lodash' import mongoose from 'mongoose'  exports.register = (server, options, next) => {   var io = require('socket.io')(server...
I'm working on a side-project of mine which integrates with Twilio. It's a Node.js app running on the Hapi.js framework.  I have the app set up with Twilio so that when I text my Twilio number, Twilio gets the request from my app's route...
Suppose I want to have REST endpoints which look roughly like this:  /projects/ /projects/project_id   /projects/project_id/items/ /projects/project_id/items/item_id   CRUD on each if makes sense. For example, /projects POST creates a new project, GE...
I'd like to see a nice log with short info about each request to my server, for use during development. I've seen the documentation on http://hapijs.com/api#request-logs, but I couldn't understand enough of it to get it working.  What sho...
I have the following validation on one of my routes:  payload: {     keywordGroups: Joi.array().items(Joi.object().keys({         language: Joi.string().required(),         containsAny: Joi.array().items(Joi.string()).default([]).when('containsAl...
In a hapi handler I try to set a header of my response earlier in the code before sending back a view.  reply().header('cache-control', 'no-cache');  {....}  reply.view('myView', myContext);   Do you I have to use the hold met...
I want every hapi route path to start with a prefix (/api/1) without adding it to each route. Is this possible?  The following route should be available with path /api/1/pets and not /pets  const Hapi = require('hapi'); const server = new Hap...
I'm setting up a simple toy app to learn React/Hapi and everything is working well till I try and set up serverside routing. The server runs without error and renders "/" properly with hello world.  However when I navigate to "/test&#...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.