Skip to content

Commit

Permalink
Adicionando .env
Browse files Browse the repository at this point in the history
  • Loading branch information
jaovitu committed Aug 23, 2022
1 parent c804bed commit c6ec733
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
*.env
*.lock
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"dev": "npx nodemon src/index.js"
},
"dependencies": {
"dotenv": "^16.0.1",
"express": "^4.18.1",
"twilio": "^3.80.1"
},
Expand Down
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
require('dotenv').config();

const express = require('express');
const twilio = require('twilio');

const app = express();

const PORT = process.env.PORT || 3000;

app.use(express.urlencoded({ extended: true }));
app.use(express.json());

Expand Down Expand Up @@ -41,4 +45,4 @@ app.post('/message', (request, response) => {

});

app.listen(3000, () => console.log('Server is running on port 3000...'));
app.listen(PORT, () => console.log('Server is running...'));

0 comments on commit c6ec733

Please sign in to comment.