Operational Endpoints for Admin, Products, Assignments, Location, Vendor, Venue completed. Geofence Testing PEnding
This commit is contained in:
@@ -17,7 +17,9 @@ import {
|
||||
LocationRoutes,
|
||||
AssignmentRoutes,
|
||||
PartnerRoutes,
|
||||
VenueRoutes
|
||||
VenueRoutes,
|
||||
ProductRoutes,
|
||||
VendorRoutes,
|
||||
} from "./routes";
|
||||
|
||||
dotenv.config();
|
||||
@@ -44,9 +46,22 @@ db.once("open", () =>
|
||||
|
||||
const app = express();
|
||||
|
||||
app.use(cors());
|
||||
app.use(
|
||||
cors({
|
||||
origin: [
|
||||
"http://localhost:1420",
|
||||
"tauri://localhost",
|
||||
"https://tauri.localhost",
|
||||
"http://tauri.localhost",
|
||||
],
|
||||
}),
|
||||
);
|
||||
app.use(express.json());
|
||||
|
||||
app.get("/test", (req, res, next) => {
|
||||
res.json({status: "success"})
|
||||
})
|
||||
|
||||
app.use("/v0/docs", swaggerUi.serve, swaggerUi.setup(swaggerDoc));
|
||||
app.use("/v0/user", UserRoutes);
|
||||
app.use("/v0/admin", AdminRoutes);
|
||||
@@ -54,6 +69,8 @@ app.use("/v0/location", LocationRoutes);
|
||||
app.use("/v0/assignment", AssignmentRoutes);
|
||||
app.use("/v0/partner", PartnerRoutes);
|
||||
app.use("/v0/venue", VenueRoutes);
|
||||
app.use("/v0/product", ProductRoutes);
|
||||
app.use("/v0/vendor", VendorRoutes);
|
||||
|
||||
app.use((err, req, res, next) => {
|
||||
const statusCode = err.status || 500;
|
||||
|
||||
Reference in New Issue
Block a user