Add DotEnv

This commit is contained in:
GuilhermeWerner
2020-06-07 23:08:36 -03:00
parent e5ad611df6
commit 81b15fea64
4 changed files with 87 additions and 79 deletions

View File

@@ -12,6 +12,7 @@
"dev": "nodemon src/server.js"
},
"dependencies": {
"dotenv": "^8.2.0",
"ejs": "^3.1.3",
"express": "^4.17.1",
"socket.io": "^2.3.0"

View File

@@ -74,7 +74,7 @@
crossorigin="anonymous"></script>
<script type="text/javascript">
var socket = io('http://localhost:3000');
var socket = io('http://localhost:3333');
function renderMessage(message) {
$('#messages').append(`<li class="list-group-item"><strong>${message.author}:</strong> ${message.content}</li>`);

View File

@@ -1,3 +1,5 @@
require('dotenv/config');
const express = require('express');
const path = require('path');
@@ -36,5 +38,5 @@ io.on('connection', socket => {
})
server.listen(3000, () =>
console.log(`Server listen on port: 3000`)
console.log(`Server listen on port: 3333`)
);

View File

@@ -411,6 +411,11 @@ dot-prop@^5.2.0:
dependencies:
is-obj "^2.0.0"
dotenv@^8.2.0:
version "8.2.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.2.0.tgz#97e619259ada750eea3e4ea3e26bceea5424b16a"
integrity sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==
duplexer3@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2"