chore: setup featherjs project

This commit is contained in:
Elias Renman
2023-05-20 09:18:45 +02:00
parent ab69ce119a
commit 0040dc6384
26 changed files with 762 additions and 0 deletions

29
server/src/validators.ts Normal file
View File

@@ -0,0 +1,29 @@
// For more information about this file see https://dove.feathersjs.com/guides/cli/validators.html
import { Ajv, addFormats } from '@feathersjs/schema'
import type { FormatsPluginOptions } from '@feathersjs/schema'
const formats: FormatsPluginOptions = [
'date-time',
'time',
'date',
'email',
'hostname',
'ipv4',
'ipv6',
'uri',
'uri-reference',
'uuid',
'uri-template',
'json-pointer',
'relative-json-pointer',
'regex'
]
export const dataValidator: Ajv = addFormats(new Ajv({}), formats)
export const queryValidator: Ajv = addFormats(
new Ajv({
coerceTypes: true
}),
formats
)