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...
I'm currently working on an app with a server that uses Hapi, and I am running into a problem whenever I try to load a .jade file. Here is the current code for my index.js file: var Hapi = require('hapi'); var internals = {}; internals...
This question already has an answer here:...
I am working HapiJs Restful web service and trying to enable cors so any client even from different domain can consume my services. I tried cors=true in server connection object but didn't work....
I am pretty new to HapiJS. I am building a service where I have two routes /route1 and /route2 both are using the plugin architecture. I have registered both as plugins on my manifest file. I want to call /route1 from /route2 so /route2 depends on...
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...
Can anyone tell me How to upload files Using nodejs and HAPI? I am getting binary data inside the handler. Here is my html code: function sendFormFromHTML(form) { //form = $(".uploadForm").form; var formData = new FormData(...
©2020 All rights reserved.