From cd3e379c5ed43da2dc467cecd50ab030133c1580 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Wed, 17 Apr 2024 00:39:12 +0530 Subject: [PATCH] fix: fastify module imports --- scraper/src/main.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scraper/src/main.js b/scraper/src/main.js index de2e9047..5eae4c82 100644 --- a/scraper/src/main.js +++ b/scraper/src/main.js @@ -1,13 +1,16 @@ -import fastify from 'fastify'; +import Fastify from 'fastify' +import cors from '@fastify/cors' import fetch from 'node-fetch'; import scraper from './scraper.js'; +const fastify = Fastify(); // Change this later const corsOptions = { origin: 'http://localhost:5173' } -fastify.register(require('@fastify/cors'), corsOptions) + +await fastify.register(cors, {corsOptions}) fastify.get('/proxy', async (request, reply) => { const { url } = request.query;