Add first two pages (placeholders), and navigation mechanism
This commit is contained in:
@@ -6,3 +6,7 @@ The purpose of this project is to build a web application that enables subscribi
|
|||||||
|
|
||||||
ENV:
|
ENV:
|
||||||
JAWSDB_URL='mysql://sq4dlf9mz49avli0:gqy5vzmzyhp0837x@tuy8t6uuvh43khkk.cbetxkdyhwsb.us-east-1.rds.amazonaws.com:3306/rxhzg1550441ftqk'
|
JAWSDB_URL='mysql://sq4dlf9mz49avli0:gqy5vzmzyhp0837x@tuy8t6uuvh43khkk.cbetxkdyhwsb.us-east-1.rds.amazonaws.com:3306/rxhzg1550441ftqk'
|
||||||
|
|
||||||
|
Run with:
|
||||||
|
$ npm start
|
||||||
|
|
||||||
|
|||||||
7
app/controllers/dobrodosli.js
Normal file
7
app/controllers/dobrodosli.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
const getDobrodosli = (req,res) => {
|
||||||
|
res.render('dobrodosli', { nextStep: '/vrstanekretnine' } );
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
getDobrodosli
|
||||||
|
};
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
const getVrstaNekretnine = (req,res) => {
|
const getVrstaNekretnine = (req,res) => {
|
||||||
res.render('vrsta_nekretnine');
|
res.render('vrsta_nekretnine', { nextStep: '/' } );
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
|||||||
3
app/views/dobrodosli.ejs
Normal file
3
app/views/dobrodosli.ejs
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
<a href="<%= nextStep %>"><button>Kreni</button></a>
|
||||||
|
|
||||||
14
app/views/layout.ejs
Normal file
14
app/views/layout.ejs
Normal 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>
|
||||||
@@ -1 +1,3 @@
|
|||||||
<html><body><h1>Hamo</h1></body></html>
|
|
||||||
|
<a href="<%= nextStep %>"> >>> </a>
|
||||||
|
|
||||||
|
|||||||
6
index.js
6
index.js
@@ -1,3 +1,4 @@
|
|||||||
|
const dobrodosli = require('./app/controllers/dobrodosli').getDobrodosli;
|
||||||
const getVrstaNekretnine = require('./app/controllers/vrsta_nekretnine').getVrstaNekretnine;
|
const getVrstaNekretnine = require('./app/controllers/vrsta_nekretnine').getVrstaNekretnine;
|
||||||
|
|
||||||
let express = require("express");
|
let express = require("express");
|
||||||
@@ -8,6 +9,7 @@ const sendNotification = require("./app/lib/sendnotification");
|
|||||||
const scrapTheItems = require("./app/lib/scraptheitems");
|
const scrapTheItems = require("./app/lib/scraptheitems");
|
||||||
const sequelize = require("./app/db/db");
|
const sequelize = require("./app/db/db");
|
||||||
const Twocheckout = require("2checkout-node");
|
const Twocheckout = require("2checkout-node");
|
||||||
|
const layout = require('express-layout');
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
app.use(bodyParser.json());
|
app.use(bodyParser.json());
|
||||||
@@ -17,6 +19,7 @@ const port = process.env.PORT || 5000;
|
|||||||
|
|
||||||
app.set('views', path.join(__dirname, '/app/views'));
|
app.set('views', path.join(__dirname, '/app/views'));
|
||||||
app.set('view engine', 'ejs');
|
app.set('view engine', 'ejs');
|
||||||
|
app.use(layout());
|
||||||
|
|
||||||
|
|
||||||
app.get("/api/sendnotifications", async function(req, res) {
|
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}!`));
|
app.listen(port, () => console.log(`Example app listening on port ${port}!`));
|
||||||
|
|||||||
18
package-lock.json
generated
18
package-lock.json
generated
@@ -473,6 +473,19 @@
|
|||||||
"vary": "~1.1.2"
|
"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": {
|
"extend": {
|
||||||
"version": "3.0.2",
|
"version": "3.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
|
"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",
|
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
|
||||||
"integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ=="
|
"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": {
|
"on-finished": {
|
||||||
"version": "2.3.0",
|
"version": "2.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
|
||||||
|
|||||||
@@ -24,6 +24,8 @@
|
|||||||
"cheerio": "^1.0.0-rc.2",
|
"cheerio": "^1.0.0-rc.2",
|
||||||
"ejs": "^2.6.1",
|
"ejs": "^2.6.1",
|
||||||
"express": "^4.16.4",
|
"express": "^4.16.4",
|
||||||
|
"express-ejs-layouts": "^2.5.0",
|
||||||
|
"express-layout": "^0.1.0",
|
||||||
"mysql2": "^1.6.4",
|
"mysql2": "^1.6.4",
|
||||||
"node-fetch": "^2.3.0",
|
"node-fetch": "^2.3.0",
|
||||||
"react-step-wizard": "^5.1.0",
|
"react-step-wizard": "^5.1.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user