title: Validate REST parameters using Joi in Nodejs
body: <p>I am trying to validate my GET request in a Hapi Node server by using joi package. The Validation is working correctly as expected. However I am struggling to find a way to return an error if there are no parameters passed. Currently if there are no parameters passed it succeeds. Also is there a way to modify the response being sent?</p>
  
  <pre><code>var Hapi = require('hapi');
  var Joi = require('joi');
  
  var server = module.exports = new Hapi.Server();
  server.connection({
      host : process.env.HOST,
      port : 3000
  });
  
  server.route({
      method: 'GET', 
      path: '/test', 
      config: {
          validate: {
              query: {
                  a: Joi.string().regex(/[0-9a-f]{8}-[0-9a-f]{4}/),
                  b: Joi.string(),
                  c: Joi.string(),
                  d: Joi.string(),
                  e: Joi.string()
              }
          }
      },
      handler: function(req, reply) {
          reply('i am a beautiful butterfly');
      }
  });
  
  server.start();
  </code></pre>