Add first two pages (placeholders), and navigation mechanism

This commit is contained in:
Senad Uka
2019-04-09 06:01:21 +02:00
parent 262f71164c
commit 5b25068009
9 changed files with 57 additions and 3 deletions

View File

@@ -6,3 +6,7 @@ The purpose of this project is to build a web application that enables subscribi
ENV:
JAWSDB_URL='mysql://sq4dlf9mz49avli0:gqy5vzmzyhp0837x@tuy8t6uuvh43khkk.cbetxkdyhwsb.us-east-1.rds.amazonaws.com:3306/rxhzg1550441ftqk'
Run with:
$ npm start

View File

@@ -0,0 +1,7 @@
const getDobrodosli = (req,res) => {
res.render('dobrodosli', { nextStep: '/vrstanekretnine' } );
}
module.exports = {
getDobrodosli
};

View File

@@ -1,5 +1,5 @@
const getVrstaNekretnine = (req,res) => {
res.render('vrsta_nekretnine');
res.render('vrsta_nekretnine', { nextStep: '/' } );
}
module.exports = {

3
app/views/dobrodosli.ejs Normal file
View File

@@ -0,0 +1,3 @@
<a href="<%= nextStep %>"><button>Kreni</button></a>

14
app/views/layout.ejs Normal file
View File

@@ -0,0 +1,14 @@
<!doctype>
<html>
<head>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
</head>
<body>
Something in your body:
<%-body%>
</body>
</html>

View File

@@ -1 +1,3 @@
<html><body><h1>Hamo</h1></body></html>
<a href="<%= nextStep %>"> >>> </a>

View File

@@ -1,3 +1,4 @@
const dobrodosli = require('./app/controllers/dobrodosli').getDobrodosli;
const getVrstaNekretnine = require('./app/controllers/vrsta_nekretnine').getVrstaNekretnine;
let express = require("express");
@@ -8,6 +9,7 @@ const sendNotification = require("./app/lib/sendnotification");
const scrapTheItems = require("./app/lib/scraptheitems");
const sequelize = require("./app/db/db");
const Twocheckout = require("2checkout-node");
const layout = require('express-layout');
const app = express();
app.use(bodyParser.json());
@@ -17,6 +19,7 @@ const port = process.env.PORT || 5000;
app.set('views', path.join(__dirname, '/app/views'));
app.set('view engine', 'ejs');
app.use(layout());
app.get("/api/sendnotifications", async function(req, res) {
@@ -101,6 +104,7 @@ app.post("/api/payforalert", function(request, response) {
});
});
app.get('/', getVrstaNekretnine);
app.get('/', dobrodosli);
app.get('/vrstanekretnine', getVrstaNekretnine);
app.listen(port, () => console.log(`Example app listening on port ${port}!`));

18
package-lock.json generated
View File

@@ -473,6 +473,19 @@
"vary": "~1.1.2"
}
},
"express-ejs-layouts": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/express-ejs-layouts/-/express-ejs-layouts-2.5.0.tgz",
"integrity": "sha512-27Kza3FR8UqvQsq1ewaxC2IwpgrQttYDEFN5s8D74Fv1VPdzsXFWsiKhPMlNauG+DrgMAmh7FhQl5hKHffd+wQ=="
},
"express-layout": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/express-layout/-/express-layout-0.1.0.tgz",
"integrity": "sha1-gydvJEO27QEQGyl03N0addWlmAY=",
"requires": {
"obj-extend": "~0.1.0"
}
},
"extend": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
@@ -821,6 +834,11 @@
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
"integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ=="
},
"obj-extend": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/obj-extend/-/obj-extend-0.1.0.tgz",
"integrity": "sha1-u0SKR3X7les0p4H5CLusLfI9u1s="
},
"on-finished": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",

View File

@@ -24,6 +24,8 @@
"cheerio": "^1.0.0-rc.2",
"ejs": "^2.6.1",
"express": "^4.16.4",
"express-ejs-layouts": "^2.5.0",
"express-layout": "^0.1.0",
"mysql2": "^1.6.4",
"node-fetch": "^2.3.0",
"react-step-wizard": "^5.1.0",