diff --git a/app/controllers/vrsta_nekretnine.js b/app/controllers/vrsta_nekretnine.js new file mode 100644 index 0000000..e69de29 diff --git a/app/views/vrsta_nekretnine.ejs b/app/views/vrsta_nekretnine.ejs new file mode 100644 index 0000000..e69de29 diff --git a/index.js b/index.js index 12d3828..19ff662 100644 --- a/index.js +++ b/index.js @@ -13,7 +13,7 @@ app.use(bodyParser.urlencoded({ extended: true })); const port = process.env.PORT || 5000; -app.get("/sendnotifications", async function(req, res) { +app.get("/api/sendnotifications", async function(req, res) { let marketAlerts = await MarketAlert.findAll(); let lastDateUpdate = await Promise.all( @@ -34,7 +34,7 @@ app.get("/sendnotifications", async function(req, res) { ); }); -app.get("/items/:url", async (req, res) => { +app.get("/api/items/:url", async (req, res) => { let url = "https://www.olx.ba/pretraga?" + req.params.url + @@ -46,7 +46,7 @@ app.get("/items/:url", async (req, res) => { }); }); -app.post("/marketalerts", function(req, res) { +app.post("/api/marketalerts", function(req, res) { const { email, last_date, olx_url } = req.body; console.log(email, last_date, olx_url); sequelize.sync().then(() => { @@ -62,7 +62,7 @@ app.post("/marketalerts", function(req, res) { }); }); -app.post("/payforalert", function(request, response) { +app.post("/api/payforalert", function(request, response) { let tco = new Twocheckout({ sellerId: "901402692", privateKey: "A28DCE5F-9292-405C-8161-F84D8BB83AFC", diff --git a/package-lock.json b/package-lock.json index 5a39076..61bfc89 100644 --- a/package-lock.json +++ b/package-lock.json @@ -401,6 +401,11 @@ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, + "ejs": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-2.6.1.tgz", + "integrity": "sha512-0xy4A/twfrRCnkhfk8ErDi5DqdAsAqeGxht4xkCUrsvhhbQNs7E+4jV0CN7+NKIY0aHE72+XvqtBIXzD31ZbXQ==" + }, "encodeurl": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", diff --git a/package.json b/package.json index 1024f0c..0dc5d34 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "@sendgrid/mail": "^6.3.1", "aws-sdk": "^2.422.0", "cheerio": "^1.0.0-rc.2", + "ejs": "^2.6.1", "express": "^4.16.4", "mysql2": "^1.6.4", "node-fetch": "^2.3.0",