Skip to content

Commit

Permalink
.env
Browse files Browse the repository at this point in the history
  • Loading branch information
devxpy committed Oct 23, 2020
1 parent 18dc173 commit 080a379
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"dotenv": "^8.2.0",
"got": "^11.8.0",
"metascraper": "^5.14.18",
"metascraper-description": "^5.14.18",
Expand Down
7 changes: 5 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ const got = require("got");
const zmq = require("zeromq");
const twitter = require("twitter-text");

require("dotenv").config();
const BIND_ADDR = process.env.BIND_ADDR;

(async function() {
const sock = zmq.socket("rep");
console.log('serving @ "tcp://127.0.0.1:3000"');
await sock.bind("tcp://127.0.0.1:3000");
await sock.bind(BIND_ADDR);
console.log(`serving @ "${BIND_ADDR}"`);

sock.on("message", async function(msg) {
msg = JSON.parse(msg);
Expand Down

0 comments on commit 080a379

Please sign in to comment.