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,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}!`));