Skip to content

Commit

Permalink
app opti...does it matter anymore?
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamoziit committed Jan 6, 2025
1 parent beb845d commit d704270
Show file tree
Hide file tree
Showing 9 changed files with 1,036 additions and 3 deletions.
1 change: 1 addition & 0 deletions ML/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
fastapi
uvicorn
torch
torchvision
Pillow
pandas
numpy
3 changes: 1 addition & 2 deletions backend/controllers/marketplace.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,14 @@ export const getSuggestions = async (req, res) => {
try {
const loggedInUser = req.params.id;
const { keys } = req.body;
console.log(keys);
const products = await Product.find({ seller: { $ne: loggedInUser } });

const filteredProducts = products.filter((product) =>
keys.some((key) =>
product.product_name.toLowerCase().includes(key.toLowerCase())
)
);
console.log(filteredProducts);

res.status(200).json(filteredProducts);
} catch (err) {
console.log(err.message)
Expand Down
9 changes: 9 additions & 0 deletions backend/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import "./sentry/instrument.js";
import dotenv from "dotenv";
dotenv.config();
import express from "express";
Expand All @@ -6,6 +7,7 @@ import bodyParser from "body-parser";
import cookieParser from "cookie-parser";
import helmet from "helmet";
import morgan from "morgan";
import * as Sentry from "@sentry/node";

import { client } from "./redis/client.js";
import connectToMongoDB from "./db/connectToMongoDB.js";
Expand Down Expand Up @@ -48,6 +50,13 @@ app.use(bodyParser.json({ limit: '1000mb', extended: true }))
app.use(bodyParser.urlencoded({ limit: '1000mb', extended: true }))
app.use(cookieParser());

// Sentry setup
app.get("/debug-sentry", function mainHandler(req, res) {
throw new Error("My first Sentry error!");
});

Sentry.setupExpressErrorHandler(app);

app.get("/api/v1", (req, res) => {
res.send("<h1>Server Up & Running</h1>");
});
Expand Down
Loading

0 comments on commit d704270

Please sign in to comment.