-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
34 lines (30 loc) · 1001 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import express from "express";
// Import routes
import stock from "./routes/stock.js"
import crypto from "./routes/crypto.js"
import news from "./routes/news.js";
import search from "./routes/search.js";
import snapshot from "./routes/snapshot.js";
import darkPools from "./routes/darkPools.js";
import shortInterest from "./routes/shortInterest.js";
// Constants
const app = express();
const PORT = process.env.PORT || 3000;
// Home page
app.get("/", async (req, res) => {
res.sendFile('home.html', {
root: "./views"
});
});
// Routes
app.use("/stock", stock); // Stock route
app.use("/crypto", crypto); // Crypto route
app.use("/news", news); // News route
app.use("/search", search); // Search stocks
app.use("/snapshot", snapshot); // snapshot route
app.use("/darkpools", darkPools); // Dark pools data
app.use("/shortinterest", shortInterest); // Short interest data
// Server listener
app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});