Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup start server and test #21

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ app.set("view engine", "ejs");
app.use(express.static(__dirname + "/views/"));

// Sets server port and logs message on success
app.listen(process.env.PORT || 1337, () => {
console.log("webhook is listening");
app.listen(process.env.PORT || 3000, () => {
console.log('webhook is listening');
try {
setInterval(handleAllURLs, delay * 1000);
} catch (error) {
Expand All @@ -76,8 +76,9 @@ app.get("/privacy-policy", (req, res) => {
res.render("privacy-policy");
});

app.get("/current-items", (req, res) => {
res.render("current-items", { data: search_urls });
app.get('/current-items', (req, res) => {
const data = search_urls;
res.render('current-items', { data });
});

app.get("/stock-updates", (req, res) => {
Expand Down Expand Up @@ -161,6 +162,7 @@ app.get("/webhook", (req, res) => {
});

async function handleAllURLs() {
console.log("scraping");
for (let item in search_urls) {
// Skips items no one is looking for
if (Object.keys(search_urls[item]['sender_ids']).length == 0) {
Expand Down
Loading