From 242c0a1a79bc295d12d318daa517b38b83b8492e Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 20 Apr 2024 00:52:37 +0530 Subject: [PATCH] chore: code cleanuo --- scraper/src/main.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scraper/src/main.js b/scraper/src/main.js index 8f6ed452..dea15f69 100644 --- a/scraper/src/main.js +++ b/scraper/src/main.js @@ -6,26 +6,25 @@ const fastify = Fastify(); // Change this later const corsOptions = { - origin: 'http://localhost:5173' + origin: 'http://localhost:5173' } await fastify.register(cors, corsOptions) fastify.get('/', async (request, reply) => { - reply.send('Hello Word!'); + reply.send('Vroom Vroom Vroom'); }); fastify.post('/scrape', async (request, reply) => { const { url, selectors } = request.body; try { - const response = await scrapeData(url, selectors); - reply.send(response); + const response = await scrapeData(url, selectors); + reply.send(response); } catch (error) { - reply.status(500).send({ error: error.message }); + reply.status(500).send({ error: error.message }); } }); - await fastify.listen(3000, (err, address) => { if (err) throw err; console.log(`Server listening on ${fastify.server.address().port}`)