How to use the koa-joi-router.Joi.date function in koa-joi-router

To help you get started, we’ve selected a few koa-joi-router examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github a-s-o / koa-docs / example / routes / store.js View on Github external
'use strict';

const t = require('koa-joi-router').Joi;

const Order = t.object().label('Order').keys({
   id: t.number(),
   petId: t.number(),
   quantity: t.number(),
   shipDate: t.date(),
   status: t.string().valid(['placed', 'approved', 'delivered']),
   complete: t.boolean()
});

const Quantity = t.number().integer().label('Quantity');

const storeInventory = {
   method: 'get',
   path: '/inventory',
   meta: {
      friendlyName: 'Store inventory',
      description: 'Returns pet inventories by status',
      extendedDescription: `
         **Implementation notes**
         * Returns a map of status codes to quantities
      `

koa-joi-router

Configurable, input validated routing for koa.

MIT
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis