修复问题
This commit is contained in:
parent
13c68f8474
commit
9870300952
|
@ -4,6 +4,9 @@ WORKDIR /app
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
RUN npm config set registry https://registry.npmmirror.com/
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
CMD ["npm", "start"]
|
CMD ["node", "server.js"]
|
||||||
|
|
|
@ -12,7 +12,8 @@
|
||||||
|
|
||||||
<div id="messageContainer"></div>
|
<div id="messageContainer"></div>
|
||||||
<script>
|
<script>
|
||||||
const ws = new WebSocket('ws://localhost:3000');
|
const port = !window.location.port ? '' : `:${window.location.port}`;
|
||||||
|
const ws = new WebSocket(`ws://${window.location.hostname}${port}`);
|
||||||
const messageContainer = document.getElementById('messageContainer');
|
const messageContainer = document.getElementById('messageContainer');
|
||||||
|
|
||||||
ws.onmessage = function(event) {
|
ws.onmessage = function(event) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user