ka1kuk commited on
Commit
e6dc26c
1 Parent(s): 37e9203

Update app.js

Browse files
Files changed (1) hide show
  1. app.js +10 -3
app.js CHANGED
@@ -4,7 +4,9 @@ const yahooFinance = require('yahoo-finance2').default;
4
  const fetch = require('node-fetch');
5
 
6
  const app = express();
7
- const PORT = 3001;
 
 
8
 
9
  app.use(cors());
10
  app.use(express.json());
@@ -235,6 +237,11 @@ app.get('/api/recommend/:symbol', async (req, res) => {
235
  }
236
  })
237
 
238
- app.listen(PORT, () => {
239
- console.log(`Server is running on http://localhost:${PORT}`);
 
 
 
 
 
240
  });
 
4
  const fetch = require('node-fetch');
5
 
6
  const app = express();
7
+ // Constants
8
+ const PORT = 7860;
9
+ const HOST = '0.0.0.0';
10
 
11
  app.use(cors());
12
  app.use(express.json());
 
237
  }
238
  })
239
 
240
+ app.listen(PORT, HOST, () => {
241
+ if (HOST == '0.0.0.0') {
242
+ console.log(`Running on http://127.0.0.1:${PORT}`);
243
+ } else {
244
+ console.log(`Running on http://${HOST}:${PORT}`);
245
+ }
246
+
247
  });