minor fix

This commit is contained in:
lion
2019-01-30 14:35:19 +01:00
parent be39fb3043
commit 25663ddf4a
4 changed files with 12 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
const Sequelize = require("sequelize");
const sequelize = new Sequelize("sql7274844", "sql7274844", "upMgevlgak", {
const sequelize = new Sequelize("sql7276322", "sql7276322", "RS53ihYlg9", {
host: "sql7.freemysqlhosting.net",
dialect: "mysql",
operatorsAliases: false

View File

@@ -12,7 +12,7 @@ app.use(bodyParser.urlencoded({ extended: true }));
const port = process.env.PORT || 5000;
app.get("/api/sendnotifications", async function(req, res) {
app.get("/sendnotifications", async function(req, res) {
let marketAlerts = await MarketAlert.findAll();
let lastDateUpdate = await Promise.all(
@@ -33,7 +33,7 @@ app.get("/api/sendnotifications", async function(req, res) {
);
});
app.get("/api/:url", async (req, res) => {
app.get("/items/:url", async (req, res) => {
let url =
"https://www.olx.ba/pretraga?" +
req.params.url +
@@ -45,7 +45,7 @@ app.get("/api/:url", async (req, res) => {
});
});
app.post("/api/marketalerts", function(req, res) {
app.post("/marketalerts", function(req, res) {
const { email, last_date, olx_url } = req.body;
sequelize.sync().then(() =>
MarketAlert.create({