diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..2edeafb --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +20 \ No newline at end of file diff --git a/server/api/index.ts b/server/api/index.ts index 1dc743a..8e8a213 100644 --- a/server/api/index.ts +++ b/server/api/index.ts @@ -1,21 +1,10 @@ import { - validate, - validateOrReject, - Contains, IsInt, - Length, - IsEmail, - IsFQDN, - IsDate, - Min, - Max, IsString, } from 'class-validator'; export class BasicQueryDTO { @IsInt() generalID!: number; - - @IsString() command!: string; } \ No newline at end of file diff --git a/server/index.ts b/server/index.ts index 0cb6ca1..1dda256 100644 --- a/server/index.ts +++ b/server/index.ts @@ -1,11 +1,20 @@ -//import 'reflect-metadata'; -//import { BasicQueryDTO } from './api'; +import 'reflect-metadata'; +import { BasicQueryDTO } from './api/index.js'; +import { validate } from 'class-validator'; -export function test(){ +export async function test(){ console.log("Hello World!"); + + const dto = new BasicQueryDTO(); + dto.command = 'None'; + dto.generalID = 1.1; + + const result = await validate(dto); + console.log(result); + //must be integer가 나타나야함 } -test(); +await test(); export default {}; \ No newline at end of file