Skip to content

Commit

Permalink
Merge pull request #30 from tanish35/master
Browse files Browse the repository at this point in the history
Minor change
  • Loading branch information
tanish35 authored Jul 30, 2024
2 parents b2b2a3f + c18b942 commit 5883338
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions backend/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
import express from 'express';
import { Request, Response } from 'express';
import cors from 'cors';
import cookieParser from 'cookie-parser';
import express from "express";
import { Request, Response } from "express";
import cors from "cors";
import cookieParser from "cookie-parser";
import "dotenv/config";
import userRoutes from './routes/userRoutes';
import userRoutes from "./routes/userRoutes";

import moderationRouter from './routes/mRuote';

import reviewRoutes from './routes/reviewRoutes';
import ratingRoutes from './routes/ratingRoute';
import moderationRouter from "./routes/mRuote";

import reviewRoutes from "./routes/reviewRoutes";
import ratingRoutes from "./routes/ratingRoute";

const app = express();
app.use(express.json());
const corsOptions = {
origin: 'http://localhost:3001',
origin: "http://localhost:3001",
credentials: true,
};
app.use(cors(corsOptions));
app.use(cookieParser());


app.use("/api/user", userRoutes);
//actual path (/api/admin/reviews/approve)
// body :-> {"content":"....."}
app.use("/api/admin",moderationRouter);

app.use("/api/review", reviewRoutes)
app.use("/api/rating", ratingRoutes)
app.use("/api/admin", moderationRouter);

app.use("/api/review", reviewRoutes);
app.use("/api/rating", ratingRoutes);

app.get("/", (req: Request, res: Response) => {
res.send("Backend is running");
});

app.listen(process.env.PORT, () => {
console.log(`Server is listening on port ${process.env.PORT}`);
});
});

0 comments on commit 5883338

Please sign in to comment.