@ancxkush/create-ts-express-mongo-starter-code
Version:
NodeJS/Express starter code with - TypeScript, MongoDB setup, Exception Handler, Logger, HTTP testing example, Swagger Docs example, Mongoose model example, JOI validation example, CRUD operations example
13 lines (10 loc) • 336 B
text/typescript
import joi from 'joi'
export const createBookSchema = joi.object({
bookId: joi.number().required(),
title: joi.string().lowercase().trim().required(),
price: joi.number().max(10000).required(),
})
export const updateBookSchema = joi.object({
title: joi.string().lowercase().trim(),
price: joi.number().max(10000),
})