Express / EJS based app

This commit is contained in:
Senad Uka
2019-03-23 05:08:21 +01:00
parent 2ceb6805ce
commit 0d7c154958
5 changed files with 10 additions and 4 deletions

View File

@@ -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",