text: const express = require("express");
  const graphqlHTTP = require("express-graphql");
  const schema = require("./schema/schema");
  const mongoose = require("mongoose");
  const cors = require("cors");
  const path = require("path");
  
  require("dotenv").config();
  const { DB_USER, DB_PASSWORD, DB_HOST, DB_NAME } = process.env;
  
  const app = express();
  
  app.use(cors());
  
  mongoose.connect(
    `mongodb+srv://${DB_USER}:${DB_PASSWORD}@${DB_HOST}/${DB_NAME}?retryWrites=true&w=majority`
  );
  mongoose.connection.once("open", () => {
    console.log("Connected to DB");
  });
  
  app.use("/storage", express.static(__dirname + "/storage"));
  app.use(express.json({ limit: "500MB" }));
  
  app.use(
    "/graphql",
    graphqlHTTP({
      schema,
      graphiql: true
    })
  );
  
  app.listen(4000, () => {
    console.log("Listening on port 4000");
  });
  