How to get graphql express server to run on ip address instead of localhost

I’m working on a project using react-native with expo and graphql in the frontend and nodejs with mongodb and graphql in the backend. Currently, I’m trying to test my project on a real device, but I can’t even sign-in. I added checks within my sign-in mutation and it doesn’t seem as if any data is being sent to the backend. This has lead me to believe that I need to run my server on my ip instead of localhost so that my device can find the server. Both my frontend and mongodb in my backend are running with my ip, but I can’t figure out how to change the server itself from localhost to my ip address. I found an article in medium that showed how to do this, but the authors server is set-up differently from mine and doesn’t use apollo server v4 nor subscriptions: article. I would appreciate any help or advice on how to do this. Thank you!

index.js

import { ApolloServer } from '@apollo/server';
import mongoose from 'mongoose';
import { decodeToken } from './services/auth.js';
import constants from './config/constants.js';
import { expressMiddleware } from '@apollo/server/express4';
import { ApolloServerPluginDrainHttpServer } from '@apollo/server/plugin/drainHttpServer';
import { createServer } from 'http';
import express from 'express';
import { makeExecutableSchema } from '@graphql-tools/schema';
import WebSocket from 'ws';
import { useServer } from 'graphql-ws/lib/use/ws';
import bodyParser from 'body-parser';
import cors from 'cors';
import typeDefs from './graphql/schema.js';
import resolvers  from './graphql/resolvers/index.js';

const schema = makeExecutableSchema({ typeDefs, resolvers });

const app = express();
const httpServer = createServer(app);

const wsServer = new WebSocket.Server({
  server: httpServer,
  path: '/graphql',
});
const serverCleanup = useServer({ schema }, wsServer);

const server = new ApolloServer({
  schema,
  csrfPrevention: true,
  cache: "bounded", 
  plugins: [
    ApolloServerPluginDrainHttpServer({ httpServer}),
    {
      async serverWillStart() {
        return {
          async drainServer() {
            await serverCleanup.dispose();
          },
        };
      },
    },
  ],
});
async function auth(req, res, next) { 
  try {
      const token = req.headers.authorization;
      if (token != null) {
        const user = await decodeToken(token);
        req.user = user;
      } 
      else {
        req.user = null; 
      }
      next();
    } catch (error) {
      throw error;
    }
  }
await server.start();
app.use('/graphql', auth, cors(), bodyParser.json(), expressMiddleware(server, { context: async ({ req }) => (
  {user: req.user})},));

mongoose
  .connect(constants.MONGODB_URL, {
       useNewUrlParser: true, 
       useUnifiedTopology: true 
    })
    .then(() => {
      console.log("MongoDB Connected Successfully");
      return httpServer.listen({port: 4000});
    }
  )
  .then((res) => {
  });