Update app.js
Browse files
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 |
-
|
|
|
|
|
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 |
-
|
|
|
|
|
|
|
|
|
|
|
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 |
});
|