mirror of
https://github.com/sergeyyarkov/digital-store.git
synced 2026-10-11 18:29:11 +03:00
Added all routes
This commit is contained in:
parent
9ee5df2f70
commit
e4585f8883
@ -1,5 +1,34 @@
|
|||||||
module.exports = function(app) {
|
const routes = {
|
||||||
app.get('/', (req, res) => {
|
// Index
|
||||||
|
indexRoute: function(req, res) {
|
||||||
res.render('index');
|
res.render('index');
|
||||||
});
|
},
|
||||||
|
|
||||||
|
// How-to-buy
|
||||||
|
howToBuyRoute: function(req, res) {
|
||||||
|
res.render('how-to-buy');
|
||||||
|
},
|
||||||
|
|
||||||
|
// Contacts
|
||||||
|
contactsRoute: function(req, res) {
|
||||||
|
res.render('contacts');
|
||||||
|
},
|
||||||
|
|
||||||
|
// Comments
|
||||||
|
commentsRoute: function(req, res) {
|
||||||
|
res.render('comments');
|
||||||
|
},
|
||||||
|
|
||||||
|
// My-orders
|
||||||
|
myOrdersRoute: function(req, res) {
|
||||||
|
res.render('my-orders');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = function(server) {
|
||||||
|
server.get('/', routes.indexRoute);
|
||||||
|
server.get('/how-to-buy', routes.howToBuyRoute);
|
||||||
|
server.get('/contacts', routes.contactsRoute);
|
||||||
|
server.get('/comments', routes.commentsRoute);
|
||||||
|
server.get('/my-orders', routes.myOrdersRoute)
|
||||||
}
|
}
|
||||||
@ -1,17 +1,15 @@
|
|||||||
const express = require('express');
|
const express = require('express');
|
||||||
const app = express();
|
const server = express();
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
// Pug config
|
// Pug config
|
||||||
app.use(express.static(path.join(__dirname, '../dist/public')));
|
server.use(express.static(path.join(__dirname, '../dist/public')));
|
||||||
app.set('view engine', 'pug');
|
server.set('view engine', 'pug');
|
||||||
app.set('views', path.join(__dirname, '../dist/views'));
|
server.set('views', path.join(__dirname, '../dist/views'));
|
||||||
|
|
||||||
|
|
||||||
require('./routes/routes')(app);
|
|
||||||
|
|
||||||
|
require('./routes/routes')(server);
|
||||||
|
|
||||||
// 404 Redirect
|
// 404 Redirect
|
||||||
app.use((req, res) => res.status(404).send('Error 404'));
|
server.use((req, res) => res.status(404).send('Error 404'));
|
||||||
|
|
||||||
app.listen(3000, () => console.log('Listen port 3000...'));
|
server.listen(3000, () => console.log('Listen port 3000...'));
|
||||||
10
dist/public/css/style.css
vendored
10
dist/public/css/style.css
vendored
@ -19,13 +19,12 @@ h1 {
|
|||||||
color: #5d5d5d;
|
color: #5d5d5d;
|
||||||
}
|
}
|
||||||
|
|
||||||
html {
|
html,
|
||||||
|
body {
|
||||||
font-family: "Roboto", sans-serif;
|
font-family: "Roboto", sans-serif;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
background-color: #F3F3F3;
|
background-color: #F3F3F3;
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
@ -317,6 +316,7 @@ nav {
|
|||||||
/* Main */
|
/* Main */
|
||||||
.main-section {
|
.main-section {
|
||||||
margin-top: 6rem;
|
margin-top: 6rem;
|
||||||
|
min-height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
header nav,
|
header nav,
|
||||||
@ -625,7 +625,7 @@ footer .container {
|
|||||||
|
|
||||||
/* Footer */
|
/* Footer */
|
||||||
footer {
|
footer {
|
||||||
margin-top: 5rem;
|
margin-top: 4rem;
|
||||||
background-color: #25998f;
|
background-color: #25998f;
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
|
|||||||
22
dist/views/assets/templates/header.pug
vendored
22
dist/views/assets/templates/header.pug
vendored
@ -4,20 +4,20 @@ header
|
|||||||
a.sidenav-trigger(href='#' data-target='slide-out')
|
a.sidenav-trigger(href='#' data-target='slide-out')
|
||||||
i.material-icons menu
|
i.material-icons menu
|
||||||
.nav-wrapper.container
|
.nav-wrapper.container
|
||||||
a.brand-logo.waves-effect.waves-light(href='#')
|
a.brand-logo.waves-effect.waves-light(href='/')
|
||||||
i.material-icons shop_two
|
i.material-icons shop_two
|
||||||
span#header-title Digital Store
|
span#header-title Digital Store
|
||||||
ul.right.hide-on-med-and-down
|
ul.right.hide-on-med-and-down
|
||||||
li.active
|
li.active
|
||||||
a(href='#') Главная
|
a(href='/') Главная
|
||||||
li
|
li
|
||||||
a(href='#') Как купить товар
|
a(href='/how-to-buy') Как купить товар
|
||||||
li
|
li
|
||||||
a(href='#') Контакты
|
a(href='/contacts') Контакты
|
||||||
li
|
li
|
||||||
a(href='#') Отзывы
|
a(href='/comments') Отзывы
|
||||||
li
|
li
|
||||||
a(href='#') Мои покупки
|
a(href='/my-orders') Мои покупки
|
||||||
// Menu-Mobile Content
|
// Menu-Mobile Content
|
||||||
ul#slide-out.sidenav
|
ul#slide-out.sidenav
|
||||||
li
|
li
|
||||||
@ -25,23 +25,23 @@ header
|
|||||||
li
|
li
|
||||||
.divider
|
.divider
|
||||||
li
|
li
|
||||||
a(href='#')
|
a(href='/')
|
||||||
i.material-icons home
|
i.material-icons home
|
||||||
| Главная
|
| Главная
|
||||||
li
|
li
|
||||||
a(href='#')
|
a(href='/how-to-buy')
|
||||||
i.material-icons info
|
i.material-icons info
|
||||||
| Как купить товар
|
| Как купить товар
|
||||||
li
|
li
|
||||||
a(href='#')
|
a(href='/contacts')
|
||||||
i.material-icons contact_support
|
i.material-icons contact_support
|
||||||
| Контакты
|
| Контакты
|
||||||
li
|
li
|
||||||
a(href='#')
|
a(href='/comments')
|
||||||
i.material-icons comment
|
i.material-icons comment
|
||||||
| Отзывы
|
| Отзывы
|
||||||
li
|
li
|
||||||
a(href='#')
|
a(href='/my-orders')
|
||||||
i.material-icons shopping_cart
|
i.material-icons shopping_cart
|
||||||
| Мои покупки
|
| Мои покупки
|
||||||
// Menu-Mobile Content END
|
// Menu-Mobile Content END
|
||||||
27
dist/views/comments.pug
vendored
Normal file
27
dist/views/comments.pug
vendored
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
//- Head HTML
|
||||||
|
include ./assets/head.pug
|
||||||
|
//- Header Template
|
||||||
|
include ./assets/templates/header.pug
|
||||||
|
|
||||||
|
main.main-section
|
||||||
|
include ./assets/templates/modals/cart.pug
|
||||||
|
include ./assets/templates/modals/pay.pug
|
||||||
|
.container
|
||||||
|
.row
|
||||||
|
.col.s12
|
||||||
|
#comments.comments.background
|
||||||
|
.comments-content
|
||||||
|
.comments-title.block-title
|
||||||
|
i.material-icons comment
|
||||||
|
h1 Отзывы о нашем магазине
|
||||||
|
.comments-text
|
||||||
|
hr
|
||||||
|
p
|
||||||
|
strong Отзывы
|
||||||
|
p
|
||||||
|
p (тут блок с отзывами)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//- Footer Template
|
||||||
|
include ./assets/templates/footer.pug
|
||||||
28
dist/views/contacts.pug
vendored
Normal file
28
dist/views/contacts.pug
vendored
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
//- Head HTML
|
||||||
|
include ./assets/head.pug
|
||||||
|
//- Header Template
|
||||||
|
include ./assets/templates/header.pug
|
||||||
|
|
||||||
|
main.main-section
|
||||||
|
include ./assets/templates/modals/cart.pug
|
||||||
|
include ./assets/templates/modals/pay.pug
|
||||||
|
.container
|
||||||
|
.row
|
||||||
|
.col.s12
|
||||||
|
#contacts.contacts.background
|
||||||
|
.contacts-content
|
||||||
|
.contacts-title.block-title
|
||||||
|
i.material-icons contacts
|
||||||
|
h1 Связаться с нами
|
||||||
|
.contacts-text
|
||||||
|
hr
|
||||||
|
p
|
||||||
|
strong Контакты
|
||||||
|
p
|
||||||
|
p 1. Почта: support@digital-store.ru
|
||||||
|
p 2. Telegram:
|
||||||
|
a(href='#') @digitalstore
|
||||||
|
|
||||||
|
|
||||||
|
//- Footer Template
|
||||||
|
include ./assets/templates/footer.pug
|
||||||
45
dist/views/how-to-buy.pug
vendored
Normal file
45
dist/views/how-to-buy.pug
vendored
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
//- Head HTML
|
||||||
|
include ./assets/head.pug
|
||||||
|
//- Header Template
|
||||||
|
include ./assets/templates/header.pug
|
||||||
|
|
||||||
|
main.main-section
|
||||||
|
include ./assets/templates/modals/cart.pug
|
||||||
|
include ./assets/templates/modals/pay.pug
|
||||||
|
.container
|
||||||
|
.row
|
||||||
|
.col.s12
|
||||||
|
#purchase.purchase.background
|
||||||
|
.purchase-content
|
||||||
|
.purchase-title.block-title
|
||||||
|
i.material-icons info
|
||||||
|
h1 Как купить товары в магазине?
|
||||||
|
.purchase-text
|
||||||
|
hr
|
||||||
|
p
|
||||||
|
strong Для того, чтобы купить аккаунты в магазине, нужно проделать следующие шаги:
|
||||||
|
p
|
||||||
|
p
|
||||||
|
| Lorem, ipsum dolor sit amet consectetur adipisicing elit. Assumenda quisquam
|
||||||
|
| voluptate aut, rerum quidem facilis labore at porro, nulla accusantium voluptatum
|
||||||
|
| magnam deserunt dolores repudiandae earum beatae provident maiores eligendi
|
||||||
|
| explicabo asperiores adipisci aliquam quas. Quisquam inventore pariatur qui dolorum
|
||||||
|
| sunt eveniet, libero ut nobis? Temporibus, nihil qui quaerat pariatur non ullam
|
||||||
|
| cupiditate, repellendus similique saepe facere, harum soluta recusandae unde! Eius
|
||||||
|
| nobis alias ipsum rem sint sit optio eligendi, magnam suscipit incidunt. Delectus
|
||||||
|
| nulla labore debitis, aperiam provident iste veniam cupiditate perferendis odio
|
||||||
|
| nostrum, repellendus, possimus similique error. Vel error necessitatibus animi velit
|
||||||
|
| dolorem quod a cupiditate repudiandae obcaecati, dignissimos officiis blanditiis rem
|
||||||
|
| eaque amet aperiam veritatis perferendis impedit ab nam, voluptas magnam ullam ipsam
|
||||||
|
| voluptatem. Voluptas, eveniet quidem. Enim rem quis repudiandae ullam cum autem
|
||||||
|
| architecto similique, sint, recusandae, quae debitis modi quas eaque aspernatur
|
||||||
|
| officia quidem? Officiis at cumque quaerat! Qui totam doloremque eligendi nam culpa
|
||||||
|
| ullam, repudiandae iure adipisci facilis error autem recusandae dolorum? Consectetur
|
||||||
|
| minima, cupiditate non quod reprehenderit laudantium. Officiis soluta harum iusto
|
||||||
|
| sed nisi, provident deleniti illum quos in omnis nostrum, ipsam vero. Maxime
|
||||||
|
| architecto perspiciatis odit vel quae? Qui dolorem sit laborum eius voluptatum
|
||||||
|
| beatae facilis! Corrupti ex temporibus quia quam earum.
|
||||||
|
|
||||||
|
|
||||||
|
//- Footer Template
|
||||||
|
include ./assets/templates/footer.pug
|
||||||
33
dist/views/my-orders.pug
vendored
Normal file
33
dist/views/my-orders.pug
vendored
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
//- Head HTML
|
||||||
|
include ./assets/head.pug
|
||||||
|
//- Header Template
|
||||||
|
include ./assets/templates/header.pug
|
||||||
|
|
||||||
|
main.main-section
|
||||||
|
include ./assets/templates/modals/cart.pug
|
||||||
|
include ./assets/templates/modals/pay.pug
|
||||||
|
.container
|
||||||
|
.row
|
||||||
|
.col.s12
|
||||||
|
#orders.orders.background
|
||||||
|
.orders-content
|
||||||
|
.orders-title.block-title
|
||||||
|
i.material-icons shopping_cart
|
||||||
|
h1 Мои покупки
|
||||||
|
.orders-text
|
||||||
|
hr
|
||||||
|
p
|
||||||
|
strong Введите почту
|
||||||
|
p
|
||||||
|
form(action='#')
|
||||||
|
.email-field(style='max-width: 400px;margin-bottom: 10px;')
|
||||||
|
label(for='email') Почта
|
||||||
|
input#email(required='' type='text' name='email')
|
||||||
|
.show-orders
|
||||||
|
button.waves-effect.waves-light.btn(type='submit') Узнать
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//- Footer Template
|
||||||
|
include ./assets/templates/footer.pug
|
||||||
Loading…
x
Reference in New Issue
Block a user