{"size": 1167, "ext": "js", "max_stars_repo_path": "EasyShop-Backend/index.js", "max_stars_repo_name": "Souryaman/EasyShop", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "EasyShop-Backend/index.js", "max_issues_repo_name": "Souryaman/EasyShop", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "EasyShop-Backend/index.js", "max_forks_repo_name": "Souryaman/EasyShop", "max_forks_repo_forks_event_min_datetime": "2021-04-06T08:18:41.000Z", "max_forks_repo_forks_event_max_datetime": "2021-04-06T08:26:06.000Z"}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": 2, "avg_line_length": 33.3428571429, "max_line_length": 76, "alphanum_fraction": 0.676092545}
const express = require("express");
const mongoose = require("mongoose");

const Address = require("./routes/Address");
const Cart = require("./routes/Cart");
const Chats = require("./routes/Chats");
const Invoices = require("./routes/Invoices");
const config = require("./config/AppConfig.ts");
const Orders = require("./routes/Orders");
const Profile = require("./routes/Profile");
const Products = require("./routes/Products");
const User = require("./routes/Users");
const Wishlist = require("./routes/Wishlist");

mongoose
  .connect(config.db_url, config.db_config)
  .then(() => console.log("Connected to EasyShop Mongo DB..."))
  .catch((error) => console.error("Error", error));

const app = express();
require("./config/Production")(app);

app.use(express.static("./"));
app.use("/api/address/", Address);
app.use("/api/cart/", Cart);
app.use("/api/chats/", Chats);
app.use("/api/invoices/", Invoices);
app.use("/api/orders/", Orders);
app.use("/api/profile/", Profile);
app.use("/api/products/", Products);
app.use("/api/user/auth/", User);
app.use("/api/wishlist/", Wishlist);

app.listen(config.Port, () => console.log(`Listening on ${config.Port}..`));
