Skip to content

Instantly share code, notes, and snippets.

View TabotCharlesBessong's full-sized avatar
🎯
Focusing

Charles Bessong Tabot TabotCharlesBessong

🎯
Focusing
View GitHub Profile
@adrianhajdin
adrianhajdin / cron.route.ts
Created September 30, 2023 10:15
Web Scraping Full Course 2023 | Build and Deploy eCommerce Price Tracker
import { NextResponse } from "next/server";
import { getLowestPrice, getHighestPrice, getAveragePrice, getEmailNotifType } from "@/lib/utils";
import { connectToDB } from "@/lib/mongoose";
import Product from "@/lib/models/product.model";
import { scrapeAmazonProduct } from "@/lib/scraper";
import { generateEmailBody, sendEmail } from "@/lib/nodemailer";
export const maxDuration = 300; // This function can run for a maximum of 300 seconds
export const dynamic = "force-dynamic";