diff --git a/package.json b/package.json index 22f1b2d..39a83d9 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "license": "ISC", "description": "", "devDependencies": { + "@types/aws-lambda": "^8.10.145", "@types/dotenv": "^6.1.1", "ts-node": "^10.9.2", "typescript": "^5.6.3" diff --git a/src/index.ts b/src/index.ts index 253c4b7..a193346 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,10 +3,11 @@ import { PrismaClient } from '@prisma/client'; import { FacilityService } from './facility/facility.service'; import { CourseService } from './course/course.service'; import { SpecialCourseService } from './course/special-course.service'; +import { Handler } from 'aws-lambda'; dotenv.config(); -async function main() { +export const handler: Handler = async () => { const prisma = new PrismaClient(); const facilityService = new FacilityService(prisma); @@ -18,6 +19,4 @@ async function main() { courseService.saveAllCourse(), specialCourseService.saveAllCourse(), ]); -} - -main(); +};