Index now works

This commit is contained in:
Senad Uka
2019-03-26 05:06:15 +01:00
parent 8c7f26b099
commit da241c8200
3 changed files with 15 additions and 7 deletions

View File

@@ -1,4 +1,8 @@
# web # 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 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'

View File

@@ -0,0 +1,7 @@
const getVrstaNekretnine = (req,res) => {
res.send('<html><body><h1>Hamo</h1></body></html>');
}
module.exports = {
getVrstaNekretnine
};

View File

@@ -1,3 +1,5 @@
const getVrstaNekretnine = require('./app/controllers/vrsta_nekretnine').getVrstaNekretnine;
let express = require("express"); let express = require("express");
const path = require("path"); const path = require("path");
const bodyParser = require("body-parser"); 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'))); app.get('/', getVrstaNekretnine);
// 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.listen(port, () => console.log(`Example app listening on port ${port}!`)); app.listen(port, () => console.log(`Example app listening on port ${port}!`));