We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1461fe7 commit 4a964daCopy full SHA for 4a964da
2 files changed
chat-app/backend/server.js
@@ -1,13 +1,16 @@
1
const express = require('express');
2
-const path = require('path');
3
const cors = require('cors');
4
5
const app = express();
6
const PORT = process.env.PORT || 3000;
+const FRONTEND_ORIGIN = process.env.FRONTEND_ORIGIN;
7
8
-app.use(cors());
+if (FRONTEND_ORIGIN) {
9
+ app.use(cors({ origin: FRONTEND_ORIGIN }));
10
+} else {
11
+ app.use(cors());
12
+}
13
app.use(express.json());
-app.use(express.static(path.join(__dirname, '../frontend')));
14
15
const messages = [
16
{
chat-app/frontend/style.css
@@ -146,6 +146,8 @@ button.secondary:hover {
146
margin: 16px 0 0;
147
display: grid;
148
gap: 12px;
149
+ max-height: 50vh;
150
+ overflow-y: auto;
151
}
152
153
.message {
0 commit comments