Skip to content

Commit

Permalink
Update MongoDB connection URL and serve static files from correct path
Browse files Browse the repository at this point in the history
  • Loading branch information
etienne committed Feb 5, 2024
1 parent 7f27582 commit bf9483a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions back/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dotenv.config();
// Connect to MongoDB
mongoose
.connect(
`mongodb://${process.env.MONGODB_USER}:${process.env.MONGODB_USER_PASSWORD}@localhost:27017/${process.env.MONGO_INITDB_DATABASE}`
`mongodb://${process.env.MONGODB_USER}:${process.env.MONGODB_USER_PASSWORD}@mongodb:27017/${process.env.MONGO_INITDB_DATABASE}`
)
.then(() => console.log("Connected to MongoDB"))
.catch((err: any) => console.error("Could not connect to MongoDB", err));
Expand All @@ -22,7 +22,7 @@ const server = http.createServer(app);
const io = new SocketIOServer(server);

// Configure Express to serve static files from the public folder
app.use(express.static("../front/public/"));
app.use(express.static("./public/index.html"));
app.use(express.json());
app.use(messageRouters);

Expand Down
File renamed without changes.

0 comments on commit bf9483a

Please sign in to comment.