This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Quick hack: Redirect to asset by URL - Endpoint extension for directus.io | |
// ========================================================================= | |
// | |
// 2021 - ToJans - Public Domain | |
// | |
// *** Don't hold me liable if it breaks anything! Quick hack, might expose all your data! | |
// | |
// You can use this endpoint extension to access assets via the folder and file structure | |
// you used in the file module, so you don't need to reference assets by guid anymore. | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//the Mirth file reader has a CSV file (now in the msg object) | |
//be sure your channel's incoming data type is 'delimited text' | |
//let's pretend this csv contains customers | |
var customers = []; | |
var header = msg.row[0]; | |
for(var i=1;i<msg['row'].length();i++) | |
{ | |
var cust = {}; | |
for (col in msg.row[i].children()) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'json' | |
group :test do | |
gem 'minitest' | |
gem 'test-unit' | |
end |