From da241c820071b83d3938a98db027b36fb31c2aaa Mon Sep 17 00:00:00 2001 From: Senad Uka Date: Tue, 26 Mar 2019 05:06:15 +0100 Subject: [PATCH] Index now works --- README.md | 6 +++++- app/controllers/vrsta_nekretnine.js | 7 +++++++ index.js | 9 +++------ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 5f9f2ad..5a940e0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ # web -The purpose of this project is to build a web application that enables subscribing to notifications when new products are published on various ad based marketplaces. The MVP will be only based on OLX.ba \ No newline at end of file +The purpose of this project is to build a web application that enables subscribing to notifications when new products are published on various ad based marketplaces. The MVP will be only based on OLX.ba + + +ENV: +JAWSDB_URL='mysql://sq4dlf9mz49avli0:gqy5vzmzyhp0837x@tuy8t6uuvh43khkk.cbetxkdyhwsb.us-east-1.rds.amazonaws.com:3306/rxhzg1550441ftqk' diff --git a/app/controllers/vrsta_nekretnine.js b/app/controllers/vrsta_nekretnine.js index e69de29..070899f 100644 --- a/app/controllers/vrsta_nekretnine.js +++ b/app/controllers/vrsta_nekretnine.js @@ -0,0 +1,7 @@ +const getVrstaNekretnine = (req,res) => { + res.send('

Hamo

'); +} + +module.exports = { + getVrstaNekretnine +}; diff --git a/index.js b/index.js index d310870..34dea52 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,5 @@ +const getVrstaNekretnine = require('./app/controllers/vrsta_nekretnine').getVrstaNekretnine; + let express = require("express"); const path = require("path"); const bodyParser = require("body-parser"); @@ -95,11 +97,6 @@ app.post("/api/payforalert", function(request, response) { }); }); -app.use(express.static(path.join(__dirname, 'frontend-react/build'))); - -// Anything that doesn't match the above, send back index.html -app.get('*', (req, res) => { - res.sendFile(path.join(__dirname + '/frontend-react/build/index.html')) -}) +app.get('/', getVrstaNekretnine); app.listen(port, () => console.log(`Example app listening on port ${port}!`));