Initial commit 🚀
19
4-natours/after-section-06/.eslintrc.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"extends": ["airbnb", "prettier", "plugin:node/recommended"],
|
||||
"plugins": ["prettier"],
|
||||
"rules": {
|
||||
"prettier/prettier": "error",
|
||||
"spaced-comment": "off",
|
||||
"no-console": "warn",
|
||||
"consistent-return": "off",
|
||||
"func-names": "off",
|
||||
"object-shorthand": "off",
|
||||
"no-process-exit": "off",
|
||||
"no-param-reassign": "off",
|
||||
"no-return-await": "off",
|
||||
"no-underscore-dangle": "off",
|
||||
"class-methods-use-this": "off",
|
||||
"prefer-destructuring": ["error", { "object": true, "array": false }],
|
||||
"no-unused-vars": ["error", { "argsIgnorePattern": "req|res|next|val" }]
|
||||
}
|
||||
}
|
||||
3
4-natours/after-section-06/.prettierrc
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"singleQuote": true
|
||||
}
|
||||
31
4-natours/after-section-06/app.js
Normal file
@@ -0,0 +1,31 @@
|
||||
const express = require('express');
|
||||
const morgan = require('morgan');
|
||||
|
||||
const tourRouter = require('./routes/tourRoutes');
|
||||
const userRouter = require('./routes/userRoutes');
|
||||
|
||||
const app = express();
|
||||
|
||||
// 1) MIDDLEWARES
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
app.use(morgan('dev'));
|
||||
}
|
||||
|
||||
app.use(express.json());
|
||||
app.use(express.static(`${__dirname}/public`));
|
||||
|
||||
app.use((req, res, next) => {
|
||||
console.log('Hello from the middleware 👋');
|
||||
next();
|
||||
});
|
||||
|
||||
app.use((req, res, next) => {
|
||||
req.requestTime = new Date().toISOString();
|
||||
next();
|
||||
});
|
||||
|
||||
// 3) ROUTES
|
||||
app.use('/api/v1/tours', tourRouter);
|
||||
app.use('/api/v1/users', userRouter);
|
||||
|
||||
module.exports = app;
|
||||
4
4-natours/after-section-06/config.env
Normal file
@@ -0,0 +1,4 @@
|
||||
NODE_ENV=development
|
||||
PORT=3000
|
||||
USERNAME=jonas
|
||||
PASSWORD=123456
|
||||
92
4-natours/after-section-06/controllers/tourController.js
Normal file
@@ -0,0 +1,92 @@
|
||||
const fs = require('fs');
|
||||
|
||||
const tours = JSON.parse(
|
||||
fs.readFileSync(`${__dirname}/../dev-data/data/tours-simple.json`)
|
||||
);
|
||||
|
||||
exports.checkID = (req, res, next, val) => {
|
||||
console.log(`Tour id is: ${val}`);
|
||||
|
||||
if (req.params.id * 1 > tours.length) {
|
||||
return res.status(404).json({
|
||||
status: 'fail',
|
||||
message: 'Invalid ID'
|
||||
});
|
||||
}
|
||||
next();
|
||||
};
|
||||
|
||||
exports.checkBody = (req, res, next) => {
|
||||
if (!req.body.name || !req.body.price) {
|
||||
return res.status(400).json({
|
||||
status: 'fail',
|
||||
message: 'Missing name or price'
|
||||
});
|
||||
}
|
||||
next();
|
||||
};
|
||||
|
||||
exports.getAllTours = (req, res) => {
|
||||
console.log(req.requestTime);
|
||||
|
||||
res.status(200).json({
|
||||
status: 'success',
|
||||
requestedAt: req.requestTime,
|
||||
results: tours.length,
|
||||
data: {
|
||||
tours
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
exports.getTour = (req, res) => {
|
||||
console.log(req.params);
|
||||
const id = req.params.id * 1;
|
||||
|
||||
const tour = tours.find(el => el.id === id);
|
||||
|
||||
res.status(200).json({
|
||||
status: 'success',
|
||||
data: {
|
||||
tour
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
exports.createTour = (req, res) => {
|
||||
// console.log(req.body);
|
||||
|
||||
const newId = tours[tours.length - 1].id + 1;
|
||||
const newTour = Object.assign({ id: newId }, req.body);
|
||||
|
||||
tours.push(newTour);
|
||||
|
||||
fs.writeFile(
|
||||
`${__dirname}/dev-data/data/tours-simple.json`,
|
||||
JSON.stringify(tours),
|
||||
err => {
|
||||
res.status(201).json({
|
||||
status: 'success',
|
||||
data: {
|
||||
tour: newTour
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
exports.updateTour = (req, res) => {
|
||||
res.status(200).json({
|
||||
status: 'success',
|
||||
data: {
|
||||
tour: '<Updated tour here...>'
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
exports.deleteTour = (req, res) => {
|
||||
res.status(204).json({
|
||||
status: 'success',
|
||||
data: null
|
||||
});
|
||||
};
|
||||
30
4-natours/after-section-06/controllers/userController.js
Normal file
@@ -0,0 +1,30 @@
|
||||
exports.getAllUsers = (req, res) => {
|
||||
res.status(500).json({
|
||||
status: 'error',
|
||||
message: 'This route is not yet defined!'
|
||||
});
|
||||
};
|
||||
exports.getUser = (req, res) => {
|
||||
res.status(500).json({
|
||||
status: 'error',
|
||||
message: 'This route is not yet defined!'
|
||||
});
|
||||
};
|
||||
exports.createUser = (req, res) => {
|
||||
res.status(500).json({
|
||||
status: 'error',
|
||||
message: 'This route is not yet defined!'
|
||||
});
|
||||
};
|
||||
exports.updateUser = (req, res) => {
|
||||
res.status(500).json({
|
||||
status: 'error',
|
||||
message: 'This route is not yet defined!'
|
||||
});
|
||||
};
|
||||
exports.deleteUser = (req, res) => {
|
||||
res.status(500).json({
|
||||
status: 'error',
|
||||
message: 'This route is not yet defined!'
|
||||
});
|
||||
};
|
||||
422
4-natours/after-section-06/dev-data/data/reviews.json
Normal file
@@ -0,0 +1,422 @@
|
||||
[
|
||||
{
|
||||
"_id": "5c8a34ed14eb5c17645c9108",
|
||||
"review": "Cras mollis nisi parturient mi nec aliquet suspendisse sagittis eros condimentum scelerisque taciti mattis praesent feugiat eu nascetur a tincidunt",
|
||||
"rating": 5,
|
||||
"user": "5c8a1dfa2f8fb814b56fa181",
|
||||
"tour": "5c88fa8cf4afda39709c2955"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a355b14eb5c17645c9109",
|
||||
"review": "Tempus curabitur faucibus auctor bibendum duis gravida tincidunt litora himenaeos facilisis vivamus vehicula potenti semper fusce suspendisse sagittis!",
|
||||
"rating": 4,
|
||||
"user": "5c8a1dfa2f8fb814b56fa181",
|
||||
"tour": "5c88fa8cf4afda39709c295a"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a359914eb5c17645c910a",
|
||||
"review": "Convallis turpis porttitor sapien ad urna efficitur dui vivamus in praesent nulla hac non potenti!",
|
||||
"rating": 5,
|
||||
"user": "5c8a1dfa2f8fb814b56fa181",
|
||||
"tour": "5c88fa8cf4afda39709c295d"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a35b614eb5c17645c910b",
|
||||
"review": "Habitasse scelerisque class quam primis convallis integer eros congue nulla proin nam faucibus parturient.",
|
||||
"rating": 4,
|
||||
"user": "5c8a1dfa2f8fb814b56fa181",
|
||||
"tour": "5c88fa8cf4afda39709c296c"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a364c14eb5c17645c910c",
|
||||
"review": "Cras consequat fames faucibus ac aliquam dolor a euismod porttitor rhoncus venenatis himenaeos montes tristique pretium libero nisi!",
|
||||
"rating": 5,
|
||||
"user": "5c8a1e1a2f8fb814b56fa182",
|
||||
"tour": "5c88fa8cf4afda39709c296c"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a368c14eb5c17645c910d",
|
||||
"review": "Laoreet justo volutpat per etiam donec at augue penatibus eu facilisis lorem phasellus ipsum tristique urna quam platea.",
|
||||
"rating": 5,
|
||||
"user": "5c8a1e1a2f8fb814b56fa182",
|
||||
"tour": "5c88fa8cf4afda39709c2974"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a36a014eb5c17645c910e",
|
||||
"review": "Senectus lectus eleifend ex lobortis cras nam cursus accumsan tellus lacus faucibus himenaeos posuere!",
|
||||
"rating": 5,
|
||||
"user": "5c8a1e1a2f8fb814b56fa182",
|
||||
"tour": "5c88fa8cf4afda39709c2970"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a36b714eb5c17645c910f",
|
||||
"review": "Pulvinar taciti etiam aenean lacinia natoque interdum fringilla suspendisse nam sapien urna!",
|
||||
"rating": 4,
|
||||
"user": "5c8a1e1a2f8fb814b56fa182",
|
||||
"tour": "5c88fa8cf4afda39709c2955"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a379a14eb5c17645c9110",
|
||||
"review": "Pretium vel inceptos fringilla sit dui fusce varius gravida platea morbi semper erat elit porttitor potenti!",
|
||||
"rating": 5,
|
||||
"user": "5c8a24402f8fb814b56fa190",
|
||||
"tour": "5c88fa8cf4afda39709c2951"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a37b114eb5c17645c9111",
|
||||
"review": "Ex a bibendum quis volutpat consequat euismod vulputate parturient laoreet diam sagittis amet at blandit.",
|
||||
"rating": 4,
|
||||
"user": "5c8a24402f8fb814b56fa190",
|
||||
"tour": "5c88fa8cf4afda39709c295a"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a37cb14eb5c17645c9112",
|
||||
"review": "Auctor euismod interdum augue tristique senectus nascetur cras justo eleifend mattis libero id adipiscing amet placerat",
|
||||
"rating": 5,
|
||||
"user": "5c8a24402f8fb814b56fa190",
|
||||
"tour": "5c88fa8cf4afda39709c2961"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a37dd14eb5c17645c9113",
|
||||
"review": "A facilisi justo ornare magnis velit diam dictumst parturient arcu nullam rhoncus nec!",
|
||||
"rating": 4,
|
||||
"user": "5c8a24402f8fb814b56fa190",
|
||||
"tour": "5c88fa8cf4afda39709c2966"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a37f114eb5c17645c9114",
|
||||
"review": "Porttitor ullamcorper rutrum semper proin mus felis varius convallis conubia nisl erat lectus eget.",
|
||||
"rating": 5,
|
||||
"user": "5c8a24402f8fb814b56fa190",
|
||||
"tour": "5c88fa8cf4afda39709c2974"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a381714eb5c17645c9115",
|
||||
"review": "Porttitor ullamcorper rutrum semper proin mus felis varius convallis conubia nisl erat lectus eget.",
|
||||
"rating": 5,
|
||||
"user": "5c8a1ec62f8fb814b56fa183",
|
||||
"tour": "5c88fa8cf4afda39709c2951"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a382d14eb5c17645c9116",
|
||||
"review": "Semper blandit felis nostra facilisi sodales pulvinar habitasse diam sapien lobortis urna nunc ipsum orci.",
|
||||
"rating": 5,
|
||||
"user": "5c8a1ec62f8fb814b56fa183",
|
||||
"tour": "5c88fa8cf4afda39709c295a"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a384114eb5c17645c9117",
|
||||
"review": "Neque amet vel integer placerat ex pretium elementum vitae quis ullamcorper nullam nunc habitant cursus justo!!!",
|
||||
"rating": 5,
|
||||
"user": "5c8a1ec62f8fb814b56fa183",
|
||||
"tour": "5c88fa8cf4afda39709c2961"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a385614eb5c17645c9118",
|
||||
"review": "Sollicitudin sagittis ex ut fringilla enim condimentum et netus tristique.",
|
||||
"rating": 5,
|
||||
"user": "5c8a1ec62f8fb814b56fa183",
|
||||
"tour": "5c88fa8cf4afda39709c295d"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a387214eb5c17645c9119",
|
||||
"review": "Semper tempus curae at platea lobortis ullamcorper curabitur luctus maecenas nisl laoreet!",
|
||||
"rating": 5,
|
||||
"user": "5c8a1ec62f8fb814b56fa183",
|
||||
"tour": "5c88fa8cf4afda39709c296c"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a38ac14eb5c17645c911a",
|
||||
"review": "Arcu adipiscing lobortis sem finibus consequat ac justo nisi pharetra ultricies facilisi!",
|
||||
"rating": 5,
|
||||
"user": "5c8a211f2f8fb814b56fa188",
|
||||
"tour": "5c88fa8cf4afda39709c296c"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a38c714eb5c17645c911b",
|
||||
"review": "Rutrum viverra turpis nunc ultricies dolor ornare metus habitant ex quis sociosqu nascetur pellentesque quam!",
|
||||
"rating": 5,
|
||||
"user": "5c8a211f2f8fb814b56fa188",
|
||||
"tour": "5c88fa8cf4afda39709c2970"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a38da14eb5c17645c911c",
|
||||
"review": "Elementum massa porttitor enim vitae eu ligula vivamus amet imperdiet urna tristique donec mattis mus erat.",
|
||||
"rating": 5,
|
||||
"user": "5c8a211f2f8fb814b56fa188",
|
||||
"tour": "5c88fa8cf4afda39709c2966"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a38ed14eb5c17645c911d",
|
||||
"review": "Fusce ullamcorper gravida libero nullam lacus litora class orci habitant sollicitudin...",
|
||||
"rating": 5,
|
||||
"user": "5c8a211f2f8fb814b56fa188",
|
||||
"tour": "5c88fa8cf4afda39709c295d"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a390d14eb5c17645c911e",
|
||||
"review": "Varius potenti proin hendrerit felis sit convallis nunc non id facilisis aliquam platea elementum",
|
||||
"rating": 5,
|
||||
"user": "5c8a211f2f8fb814b56fa188",
|
||||
"tour": "5c88fa8cf4afda39709c2951"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a391f14eb5c17645c911f",
|
||||
"review": "Sem feugiat sed lorem vel dignissim platea habitasse dolor suscipit ultricies dapibus",
|
||||
"rating": 5,
|
||||
"user": "5c8a211f2f8fb814b56fa188",
|
||||
"tour": "5c88fa8cf4afda39709c2955"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a395b14eb5c17645c9120",
|
||||
"review": "Sem feugiat sed lorem vel dignissim platea habitasse dolor suscipit ultricies dapibus",
|
||||
"rating": 5,
|
||||
"user": "5c8a20d32f8fb814b56fa187",
|
||||
"tour": "5c88fa8cf4afda39709c2951"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a399014eb5c17645c9121",
|
||||
"review": "Tortor dolor sed vehicula neque ultrices varius orci feugiat dignissim auctor consequat.",
|
||||
"rating": 4,
|
||||
"user": "5c8a20d32f8fb814b56fa187",
|
||||
"tour": "5c88fa8cf4afda39709c295d"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a39a214eb5c17645c9122",
|
||||
"review": "Felis mauris aenean eu lectus fringilla habitasse nullam eros senectus ante etiam!",
|
||||
"rating": 5,
|
||||
"user": "5c8a20d32f8fb814b56fa187",
|
||||
"tour": "5c88fa8cf4afda39709c2970"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a39b614eb5c17645c9123",
|
||||
"review": "Blandit varius nascetur est felis praesent lorem himenaeos pretium dapibus tellus bibendum consequat ac duis",
|
||||
"rating": 3,
|
||||
"user": "5c8a20d32f8fb814b56fa187",
|
||||
"tour": "5c88fa8cf4afda39709c2974"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3a7014eb5c17645c9124",
|
||||
"review": "Blandit varius nascetur est felis praesent lorem himenaeos pretium dapibus tellus bibendum consequat ac duis",
|
||||
"rating": 5,
|
||||
"user": "5c8a23c82f8fb814b56fa18d",
|
||||
"tour": "5c88fa8cf4afda39709c2955"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3a8d14eb5c17645c9125",
|
||||
"review": "Iaculis mauris eget sed nec lobortis rhoncus montes etiam dapibus suspendisse hendrerit quam pellentesque potenti sapien!",
|
||||
"rating": 5,
|
||||
"user": "5c8a23c82f8fb814b56fa18d",
|
||||
"tour": "5c88fa8cf4afda39709c2951"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3a9914eb5c17645c9126",
|
||||
"review": "Netus eleifend adipiscing ligula placerat fusce orci sollicitudin vivamus conubia.",
|
||||
"rating": 5,
|
||||
"user": "5c8a23c82f8fb814b56fa18d",
|
||||
"tour": "5c88fa8cf4afda39709c295a"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3aaa14eb5c17645c9127",
|
||||
"review": "Eleifend suspendisse ultricies platea primis ut ornare purus vel taciti faucibus justo nunc",
|
||||
"rating": 4,
|
||||
"user": "5c8a23c82f8fb814b56fa18d",
|
||||
"tour": "5c88fa8cf4afda39709c2961"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3abc14eb5c17645c9128",
|
||||
"review": "Malesuada consequat congue vel gravida eros conubia in sapien praesent diam!",
|
||||
"rating": 4,
|
||||
"user": "5c8a23c82f8fb814b56fa18d",
|
||||
"tour": "5c88fa8cf4afda39709c2966"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3acf14eb5c17645c9129",
|
||||
"review": "Curabitur maximus montes vestibulum nulla vel dictum cubilia himenaeos nunc hendrerit amet urna.",
|
||||
"rating": 5,
|
||||
"user": "5c8a23c82f8fb814b56fa18d",
|
||||
"tour": "5c88fa8cf4afda39709c2970"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3b1e14eb5c17645c912a",
|
||||
"review": "Curabitur maximus montes vestibulum nulla vel dictum cubilia himenaeos nunc hendrerit amet urna.",
|
||||
"rating": 5,
|
||||
"user": "5c8a23de2f8fb814b56fa18e",
|
||||
"tour": "5c88fa8cf4afda39709c296c"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3b3214eb5c17645c912b",
|
||||
"review": "Sociosqu eleifend tincidunt aenean condimentum gravida lorem arcu pellentesque felis dui feugiat nec.",
|
||||
"rating": 5,
|
||||
"user": "5c8a23de2f8fb814b56fa18e",
|
||||
"tour": "5c88fa8cf4afda39709c2974"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3b4714eb5c17645c912c",
|
||||
"review": "Ridiculus facilisis sem id aenean amet penatibus gravida phasellus a mus dui lacinia accumsan!!",
|
||||
"rating": 1,
|
||||
"user": "5c8a23de2f8fb814b56fa18e",
|
||||
"tour": "5c88fa8cf4afda39709c2966"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3b6714eb5c17645c912e",
|
||||
"review": "Venenatis molestie luctus cubilia taciti tempor faucibus nostra nisi curae integer.",
|
||||
"rating": 5,
|
||||
"user": "5c8a23de2f8fb814b56fa18e",
|
||||
"tour": "5c88fa8cf4afda39709c2951"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3b7c14eb5c17645c912f",
|
||||
"review": "Tempor pellentesque eu placerat auctor enim nam suscipit tincidunt natoque ipsum est.",
|
||||
"rating": 5,
|
||||
"user": "5c8a23de2f8fb814b56fa18e",
|
||||
"tour": "5c88fa8cf4afda39709c2955"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3b9f14eb5c17645c9130",
|
||||
"review": "Tempor pellentesque eu placerat auctor enim nam suscipit tincidunt natoque ipsum est.",
|
||||
"rating": 5,
|
||||
"user": "5c8a24282f8fb814b56fa18f",
|
||||
"tour": "5c88fa8cf4afda39709c295a"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3bc414eb5c17645c9131",
|
||||
"review": "Conubia semper efficitur rhoncus suspendisse taciti lectus ex sapien dolor molestie fusce class.",
|
||||
"rating": 5,
|
||||
"user": "5c8a24282f8fb814b56fa18f",
|
||||
"tour": "5c88fa8cf4afda39709c2961"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3bdc14eb5c17645c9132",
|
||||
"review": "Conubia pharetra pulvinar libero hac class congue curabitur mi porttitor!!",
|
||||
"rating": 5,
|
||||
"user": "5c8a24282f8fb814b56fa18f",
|
||||
"tour": "5c88fa8cf4afda39709c2966"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3bf514eb5c17645c9133",
|
||||
"review": "Nullam felis dictumst eros nulla torquent arcu inceptos mi faucibus ridiculus pellentesque gravida mauris.",
|
||||
"rating": 5,
|
||||
"user": "5c8a24282f8fb814b56fa18f",
|
||||
"tour": "5c88fa8cf4afda39709c2974"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3c2514eb5c17645c9134",
|
||||
"review": "Euismod suscipit ipsum efficitur rutrum dis mus dictumst laoreet lectus.",
|
||||
"rating": 5,
|
||||
"user": "5c8a245f2f8fb814b56fa191",
|
||||
"tour": "5c88fa8cf4afda39709c2951"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3c3b14eb5c17645c9135",
|
||||
"review": "Massa orci lacus suspendisse maximus ad integer donec arcu parturient facilisis accumsan consectetur non",
|
||||
"rating": 4,
|
||||
"user": "5c8a245f2f8fb814b56fa191",
|
||||
"tour": "5c88fa8cf4afda39709c295a"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3c5314eb5c17645c9136",
|
||||
"review": "Blandit varius finibus imperdiet tortor hendrerit erat rhoncus dictumst inceptos massa in.",
|
||||
"rating": 5,
|
||||
"user": "5c8a245f2f8fb814b56fa191",
|
||||
"tour": "5c88fa8cf4afda39709c2961"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3c6814eb5c17645c9137",
|
||||
"review": "Tristique semper proin pellentesque ipsum urna habitasse venenatis tincidunt morbi nisi at",
|
||||
"rating": 4,
|
||||
"user": "5c8a245f2f8fb814b56fa191",
|
||||
"tour": "5c88fa8cf4afda39709c295d"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3c7814eb5c17645c9138",
|
||||
"review": "Potenti etiam placerat mi metus ipsum curae eget nisl torquent pretium",
|
||||
"rating": 4,
|
||||
"user": "5c8a245f2f8fb814b56fa191",
|
||||
"tour": "5c88fa8cf4afda39709c2966"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3c9014eb5c17645c9139",
|
||||
"review": "Molestie non montes at fermentum cubilia quis dis placerat maecenas vulputate sapien facilisis",
|
||||
"rating": 5,
|
||||
"user": "5c8a245f2f8fb814b56fa191",
|
||||
"tour": "5c88fa8cf4afda39709c2970"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3ca314eb5c17645c913a",
|
||||
"review": "Velit vulputate faucibus in nascetur praesent potenti primis pulvinar tempor",
|
||||
"rating": 5,
|
||||
"user": "5c8a245f2f8fb814b56fa191",
|
||||
"tour": "5c88fa8cf4afda39709c296c"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3cdc14eb5c17645c913b",
|
||||
"review": "Magna magnis tellus dui vivamus donec placerat vehicula erat turpis",
|
||||
"rating": 5,
|
||||
"user": "5c8a24822f8fb814b56fa192",
|
||||
"tour": "5c88fa8cf4afda39709c2955"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3cf414eb5c17645c913c",
|
||||
"review": "Ligula lorem taciti fringilla himenaeos ex aliquam litora nam ad maecenas sit phasellus lectus!!",
|
||||
"rating": 5,
|
||||
"user": "5c8a24822f8fb814b56fa192",
|
||||
"tour": "5c88fa8cf4afda39709c2951"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3d1e14eb5c17645c913d",
|
||||
"review": "Nam ultrices quis leo viverra tristique curae facilisi luctus sapien eleifend fames orci lacinia pulvinar.",
|
||||
"rating": 4,
|
||||
"user": "5c8a24822f8fb814b56fa192",
|
||||
"tour": "5c88fa8cf4afda39709c2961"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3d3a14eb5c17645c913e",
|
||||
"review": "Ullamcorper ac nec id habitant a commodo eget libero cras congue!",
|
||||
"rating": 4,
|
||||
"user": "5c8a24822f8fb814b56fa192",
|
||||
"tour": "5c88fa8cf4afda39709c2970"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3d5314eb5c17645c913f",
|
||||
"review": "Ultrices nam dui ex posuere velit varius himenaeos bibendum fermentum sollicitudin purus",
|
||||
"rating": 5,
|
||||
"user": "5c8a24822f8fb814b56fa192",
|
||||
"tour": "5c88fa8cf4afda39709c2974"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3d8614eb5c17645c9140",
|
||||
"review": "Ultrices nam dui ex posuere velit varius himenaeos bibendum fermentum sollicitudin purus",
|
||||
"rating": 5,
|
||||
"user": "5c8a24a02f8fb814b56fa193",
|
||||
"tour": "5c88fa8cf4afda39709c2974"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3d9b14eb5c17645c9141",
|
||||
"review": "Vitae vulputate id quam metus orci cras mollis vivamus vehicula sapien et",
|
||||
"rating": 2,
|
||||
"user": "5c8a24a02f8fb814b56fa193",
|
||||
"tour": "5c88fa8cf4afda39709c296c"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3de514eb5c17645c9143",
|
||||
"review": "Sem risus tempor auctor mattis netus montes tincidunt mollis lacinia natoque adipiscing",
|
||||
"rating": 5,
|
||||
"user": "5c8a24a02f8fb814b56fa193",
|
||||
"tour": "5c88fa8cf4afda39709c2961"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3e0714eb5c17645c9144",
|
||||
"review": "Feugiat egestas ac pulvinar quis dui ligula tempor ad platea quisque scelerisque!",
|
||||
"rating": 5,
|
||||
"user": "5c8a24a02f8fb814b56fa193",
|
||||
"tour": "5c88fa8cf4afda39709c2951"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a3e63e12c44188b4dbc5b",
|
||||
"review": "Quisque egestas faucibus primis ridiculus mi felis tristique curabitur habitasse vehicula",
|
||||
"rating": 4,
|
||||
"user": "5c8a24a02f8fb814b56fa193",
|
||||
"tour": "5c88fa8cf4afda39709c2966"
|
||||
}
|
||||
]
|
||||
17
4-natours/after-section-06/dev-data/data/tour5.js
Normal file
@@ -0,0 +1,17 @@
|
||||
/* eslint-disable */
|
||||
const tour5 = {
|
||||
id: 5,
|
||||
name: 'The Sports Lover',
|
||||
startLocation: 'California, USA',
|
||||
nextStartDate: 'July 2021',
|
||||
duration: 14,
|
||||
maxGroupSize: 8,
|
||||
difficulty: 'difficult',
|
||||
avgRating: 4.7,
|
||||
numReviews: 23,
|
||||
regPrice: 2997,
|
||||
shortDescription:
|
||||
'Surfing, skating, parajumping, rock climbing and more, all in one tour',
|
||||
longDescription:
|
||||
'Nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\nVoluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur!'
|
||||
};
|
||||
140
4-natours/after-section-06/dev-data/data/tours-simple.json
Normal file
@@ -0,0 +1,140 @@
|
||||
[
|
||||
{
|
||||
"id": 0,
|
||||
"name": "The Forest Hiker",
|
||||
"duration": 5,
|
||||
"maxGroupSize": 25,
|
||||
"difficulty": "easy",
|
||||
"ratingsAverage": 4.7,
|
||||
"ratingsQuantity": 37,
|
||||
"price": 397,
|
||||
"summary": "Breathtaking hike through the Canadian Banff National Park",
|
||||
"description": "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
||||
"imageCover": "tour-1-cover.jpg",
|
||||
"images": ["tour-1-1.jpg", "tour-1-2.jpg", "tour-1-3.jpg"],
|
||||
"startDates": ["2021-04-25,10:00", "2021-07-20,10:00", "2021-10-05,10:00"]
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "The Sea Explorer",
|
||||
"duration": 7,
|
||||
"maxGroupSize": 15,
|
||||
"difficulty": "medium",
|
||||
"ratingsAverage": 4.8,
|
||||
"ratingsQuantity": 23,
|
||||
"price": 497,
|
||||
"summary": "Exploring the jaw-dropping US east coast by foot and by boat",
|
||||
"description": "Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\nIrure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
|
||||
"imageCover": "tour-2-cover.jpg",
|
||||
"images": ["tour-2-1.jpg", "tour-2-2.jpg", "tour-2-3.jpg"],
|
||||
"startDates": ["2021-06-19,10:00", "2021-07-20,10:00", "2021-08-18,10:00"]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"name": "The Snow Adventurer",
|
||||
"duration": 4,
|
||||
"maxGroupSize": 10,
|
||||
"difficulty": "difficult",
|
||||
"ratingsAverage": 4.5,
|
||||
"ratingsQuantity": 13,
|
||||
"price": 997,
|
||||
"summary": "Exciting adventure in the snow with snowboarding and skiing",
|
||||
"description": "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua, ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum!\nDolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur, exercitation ullamco laboris nisi ut aliquip. Lorem ipsum dolor sit amet, consectetur adipisicing elit!",
|
||||
"imageCover": "tour-3-cover.jpg",
|
||||
"images": ["tour-3-1.jpg", "tour-3-2.jpg", "tour-3-3.jpg"],
|
||||
"startDates": ["2022-01-05,10:00", "2022-02-12,10:00", "2023-01-06,10:00"]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"name": "The City Wanderer",
|
||||
"duration": 9,
|
||||
"maxGroupSize": 20,
|
||||
"difficulty": "easy",
|
||||
"ratingsAverage": 4.6,
|
||||
"ratingsQuantity": 54,
|
||||
"price": 1197,
|
||||
"summary": "Living the life of Wanderlust in the US' most beatiful cities",
|
||||
"description": "Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat lorem ipsum dolor sit amet.\nConsectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur, nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat!",
|
||||
"imageCover": "tour-4-cover.jpg",
|
||||
"images": ["tour-4-1.jpg", "tour-4-2.jpg", "tour-4-3.jpg"],
|
||||
"startDates": ["2021-03-11,10:00", "2021-05-02,10:00", "2021-06-09,10:00"]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"name": "The Park Camper",
|
||||
"duration": 10,
|
||||
"maxGroupSize": 15,
|
||||
"difficulty": "medium",
|
||||
"ratingsAverage": 4.9,
|
||||
"ratingsQuantity": 19,
|
||||
"price": 1497,
|
||||
"summary": "Breathing in Nature in America's most spectacular National Parks",
|
||||
"description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\nDuis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum!",
|
||||
"imageCover": "tour-5-cover.jpg",
|
||||
"images": ["tour-5-1.jpg", "tour-5-2.jpg", "tour-5-3.jpg"],
|
||||
"startDates": ["2021-08-05,10:00", "2022-03-20,10:00", "2022-08-12,10:00"]
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"name": "The Sports Lover",
|
||||
"duration": 14,
|
||||
"maxGroupSize": 8,
|
||||
"difficulty": "difficult",
|
||||
"ratingsAverage": 4.7,
|
||||
"ratingsQuantity": 28,
|
||||
"price": 2997,
|
||||
"summary": "Surfing, skating, parajumping, rock climbing and more, all in one tour",
|
||||
"description": "Nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\nVoluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur!",
|
||||
"imageCover": "tour-6-cover.jpg",
|
||||
"images": ["tour-6-1.jpg", "tour-6-2.jpg", "tour-6-3.jpg"],
|
||||
"startDates": ["2021-07-19,10:00", "2021-09-06,10:00", "2022-03-18,10:00"]
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"name": "The Wine Taster",
|
||||
"duration": 5,
|
||||
"maxGroupSize": 8,
|
||||
"difficulty": "easy",
|
||||
"ratingsAverage": 4.5,
|
||||
"ratingsQuantity": 35,
|
||||
"price": 1997,
|
||||
"summary": "Exquisite wines, scenic views, exclusive barrel tastings, and much more",
|
||||
"description": "Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\nIrure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
|
||||
"imageCover": "tour-7-cover.jpg",
|
||||
"images": ["tour-7-1.jpg", "tour-7-2.jpg", "tour-7-3.jpg"],
|
||||
"startDates": ["2021-02-12,10:00", "2021-04-14,10:00", "2021-09-01,10:00"]
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"name": "The Star Gazer",
|
||||
"duration": 9,
|
||||
"maxGroupSize": 8,
|
||||
"difficulty": "medium",
|
||||
"ratingsAverage": 4.7,
|
||||
"ratingsQuantity": 28,
|
||||
"price": 2997,
|
||||
"summary": "The most remote and stunningly beautiful places for seeing the night sky",
|
||||
"description": "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
||||
"imageCover": "tour-8-cover.jpg",
|
||||
"images": ["tour-8-1.jpg", "tour-8-2.jpg", "tour-8-3.jpg"],
|
||||
"startDates": ["2021-03-23,10:00", "2021-10-25,10:00", "2022-01-30,10:00"]
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"name": "The Northern Lights",
|
||||
"duration": 3,
|
||||
"maxGroupSize": 12,
|
||||
"difficulty": "easy",
|
||||
"ratingsAverage": 4.9,
|
||||
"ratingsQuantity": 33,
|
||||
"price": 1497,
|
||||
"summary": "Enjoy the Northern Lights in one of the best places in the world",
|
||||
"description": "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua, ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum!\nDolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur, exercitation ullamco laboris nisi ut aliquip. Lorem ipsum dolor sit amet, consectetur adipisicing elit!",
|
||||
"imageCover": "tour-9-cover.jpg",
|
||||
"images": ["tour-9-1.jpg", "tour-9-2.jpg", "tour-9-3.jpg"],
|
||||
"startDates": ["2021-12-16,10:00", "2022-01-16,10:00", "2022-12-12,10:00"]
|
||||
},
|
||||
{ "id": 9, "name": "Test Tour", "duration": 10, "difficulty": "easy" },
|
||||
{ "id": 10, "name": "Test Tour", "duration": 10, "difficulty": "easy" },
|
||||
{ "id": 11, "name": "Test Tour 2", "duration": 5, "difficulty": "easy" }
|
||||
]
|
||||
470
4-natours/after-section-06/dev-data/data/tours.json
Normal file
@@ -0,0 +1,470 @@
|
||||
[
|
||||
{
|
||||
"startLocation": {
|
||||
"description": "Miami, USA",
|
||||
"type": "Point",
|
||||
"coordinates": [-80.185942, 25.774772],
|
||||
"address": "301 Biscayne Blvd, Miami, FL 33132, USA"
|
||||
},
|
||||
"ratingsAverage": 4.8,
|
||||
"ratingsQuantity": 6,
|
||||
"images": ["tour-2-1.jpg", "tour-2-2.jpg", "tour-2-3.jpg"],
|
||||
"startDates": [
|
||||
"2021-06-19T09:00:00.000Z",
|
||||
"2021-07-20T09:00:00.000Z",
|
||||
"2021-08-18T09:00:00.000Z"
|
||||
],
|
||||
"_id": "5c88fa8cf4afda39709c2955",
|
||||
"name": "The Sea Explorer",
|
||||
"duration": 7,
|
||||
"maxGroupSize": 15,
|
||||
"difficulty": "medium",
|
||||
"guides": ["5c8a22c62f8fb814b56fa18b", "5c8a1f4e2f8fb814b56fa185"],
|
||||
"price": 497,
|
||||
"summary": "Exploring the jaw-dropping US east coast by foot and by boat",
|
||||
"description": "Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\nIrure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
|
||||
"imageCover": "tour-2-cover.jpg",
|
||||
"locations": [
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c2959",
|
||||
"description": "Lummus Park Beach",
|
||||
"type": "Point",
|
||||
"coordinates": [-80.128473, 25.781842],
|
||||
"day": 1
|
||||
},
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c2958",
|
||||
"description": "Islamorada",
|
||||
"type": "Point",
|
||||
"coordinates": [-80.647885, 24.909047],
|
||||
"day": 2
|
||||
},
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c2957",
|
||||
"description": "Sombrero Beach",
|
||||
"type": "Point",
|
||||
"coordinates": [-81.0784, 24.707496],
|
||||
"day": 3
|
||||
},
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c2956",
|
||||
"description": "West Key",
|
||||
"type": "Point",
|
||||
"coordinates": [-81.768719, 24.552242],
|
||||
"day": 5
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"startLocation": {
|
||||
"description": "Banff, CAN",
|
||||
"type": "Point",
|
||||
"coordinates": [-115.570154, 51.178456],
|
||||
"address": "224 Banff Ave, Banff, AB, Canada"
|
||||
},
|
||||
"ratingsAverage": 5,
|
||||
"ratingsQuantity": 9,
|
||||
"images": ["tour-1-1.jpg", "tour-1-2.jpg", "tour-1-3.jpg"],
|
||||
"startDates": [
|
||||
"2021-04-25T09:00:00.000Z",
|
||||
"2021-07-20T09:00:00.000Z",
|
||||
"2021-10-05T09:00:00.000Z"
|
||||
],
|
||||
"_id": "5c88fa8cf4afda39709c2951",
|
||||
"name": "The Forest Hiker",
|
||||
"duration": 5,
|
||||
"maxGroupSize": 25,
|
||||
"difficulty": "easy",
|
||||
"guides": [
|
||||
"5c8a21d02f8fb814b56fa189",
|
||||
"5c8a201e2f8fb814b56fa186",
|
||||
"5c8a1f292f8fb814b56fa184"
|
||||
],
|
||||
"price": 397,
|
||||
"summary": "Breathtaking hike through the Canadian Banff National Park",
|
||||
"description": "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
||||
"imageCover": "tour-1-cover.jpg",
|
||||
"locations": [
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c2954",
|
||||
"description": "Banff National Park",
|
||||
"type": "Point",
|
||||
"coordinates": [-116.214531, 51.417611],
|
||||
"day": 1
|
||||
},
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c2953",
|
||||
"description": "Jasper National Park",
|
||||
"type": "Point",
|
||||
"coordinates": [-118.076152, 52.875223],
|
||||
"day": 3
|
||||
},
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c2952",
|
||||
"description": "Glacier National Park of Canada",
|
||||
"type": "Point",
|
||||
"coordinates": [-117.490309, 51.261937],
|
||||
"day": 5
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"startLocation": {
|
||||
"description": "Aspen, USA",
|
||||
"type": "Point",
|
||||
"coordinates": [-106.822318, 39.190872],
|
||||
"address": "419 S Mill St, Aspen, CO 81611, USA"
|
||||
},
|
||||
"ratingsAverage": 4.5,
|
||||
"ratingsQuantity": 6,
|
||||
"images": ["tour-3-1.jpg", "tour-3-2.jpg", "tour-3-3.jpg"],
|
||||
"startDates": [
|
||||
"2022-01-05T10:00:00.000Z",
|
||||
"2022-02-12T10:00:00.000Z",
|
||||
"2023-01-06T10:00:00.000Z"
|
||||
],
|
||||
"_id": "5c88fa8cf4afda39709c295a",
|
||||
"name": "The Snow Adventurer",
|
||||
"duration": 4,
|
||||
"maxGroupSize": 10,
|
||||
"difficulty": "difficult",
|
||||
"guides": [
|
||||
"5c8a21d02f8fb814b56fa189",
|
||||
"5c8a23412f8fb814b56fa18c",
|
||||
"5c8a1f4e2f8fb814b56fa185"
|
||||
],
|
||||
"price": 997,
|
||||
"summary": "Exciting adventure in the snow with snowboarding and skiing",
|
||||
"description": "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua, ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum!\nDolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur, exercitation ullamco laboris nisi ut aliquip. Lorem ipsum dolor sit amet, consectetur adipisicing elit!",
|
||||
"imageCover": "tour-3-cover.jpg",
|
||||
"locations": [
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c295c",
|
||||
"description": "Aspen Highlands",
|
||||
"type": "Point",
|
||||
"coordinates": [-106.855385, 39.182677],
|
||||
"day": 1
|
||||
},
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c295b",
|
||||
"description": "Beaver Creek",
|
||||
"type": "Point",
|
||||
"coordinates": [-106.516623, 39.60499],
|
||||
"day": 2
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"startLocation": {
|
||||
"description": "Las Vegas, USA",
|
||||
"type": "Point",
|
||||
"coordinates": [-115.172652, 36.110904],
|
||||
"address": "3663 S Las Vegas Blvd, Las Vegas, NV 89109, USA"
|
||||
},
|
||||
"ratingsAverage": 4.7,
|
||||
"ratingsQuantity": 7,
|
||||
"images": ["tour-5-1.jpg", "tour-5-2.jpg", "tour-5-3.jpg"],
|
||||
"startDates": [
|
||||
"2021-08-05T09:00:00.000Z",
|
||||
"2022-03-20T10:00:00.000Z",
|
||||
"2022-08-12T09:00:00.000Z"
|
||||
],
|
||||
"_id": "5c88fa8cf4afda39709c2961",
|
||||
"name": "The Park Camper",
|
||||
"duration": 10,
|
||||
"maxGroupSize": 15,
|
||||
"difficulty": "medium",
|
||||
"guides": [
|
||||
"5c8a21f22f8fb814b56fa18a",
|
||||
"5c8a23412f8fb814b56fa18c",
|
||||
"5c8a201e2f8fb814b56fa186"
|
||||
],
|
||||
"price": 1497,
|
||||
"summary": "Breathing in Nature in America's most spectacular National Parks",
|
||||
"description": "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\nDuis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum!",
|
||||
"imageCover": "tour-5-cover.jpg",
|
||||
"locations": [
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c2965",
|
||||
"description": "Zion Canyon National Park",
|
||||
"type": "Point",
|
||||
"coordinates": [-112.987418, 37.198125],
|
||||
"day": 1
|
||||
},
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c2964",
|
||||
"description": "Antelope Canyon",
|
||||
"type": "Point",
|
||||
"coordinates": [-111.376161, 36.86438],
|
||||
"day": 4
|
||||
},
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c2963",
|
||||
"description": "Grand Canyon National Park",
|
||||
"type": "Point",
|
||||
"coordinates": [-112.115763, 36.058973],
|
||||
"day": 5
|
||||
},
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c2962",
|
||||
"description": "Joshua Tree National Park",
|
||||
"type": "Point",
|
||||
"coordinates": [-116.107963, 34.011646],
|
||||
"day": 9
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"startLocation": {
|
||||
"description": "NYC, USA",
|
||||
"type": "Point",
|
||||
"coordinates": [-73.985141, 40.75894],
|
||||
"address": "Manhattan, NY 10036, USA"
|
||||
},
|
||||
"ratingsAverage": 4.6,
|
||||
"ratingsQuantity": 5,
|
||||
"images": ["tour-4-1.jpg", "tour-4-2.jpg", "tour-4-3.jpg"],
|
||||
"startDates": [
|
||||
"2021-03-11T10:00:00.000Z",
|
||||
"2021-05-02T09:00:00.000Z",
|
||||
"2021-06-09T09:00:00.000Z"
|
||||
],
|
||||
"_id": "5c88fa8cf4afda39709c295d",
|
||||
"name": "The City Wanderer",
|
||||
"duration": 9,
|
||||
"maxGroupSize": 20,
|
||||
"difficulty": "easy",
|
||||
"guides": ["5c8a22c62f8fb814b56fa18b", "5c8a201e2f8fb814b56fa186"],
|
||||
"price": 1197,
|
||||
"summary": "Living the life of Wanderlust in the US' most beatiful cities",
|
||||
"description": "Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat lorem ipsum dolor sit amet.\nConsectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur, nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat!",
|
||||
"imageCover": "tour-4-cover.jpg",
|
||||
"locations": [
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c2960",
|
||||
"description": "New York",
|
||||
"type": "Point",
|
||||
"coordinates": [-73.967696, 40.781821],
|
||||
"day": 1
|
||||
},
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c295f",
|
||||
"description": "Los Angeles",
|
||||
"type": "Point",
|
||||
"coordinates": [-118.324396, 34.097984],
|
||||
"day": 3
|
||||
},
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c295e",
|
||||
"description": "San Francisco",
|
||||
"type": "Point",
|
||||
"coordinates": [-122.408865, 37.787825],
|
||||
"day": 5
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"startLocation": {
|
||||
"description": "California, USA",
|
||||
"type": "Point",
|
||||
"coordinates": [-118.803461, 34.006072],
|
||||
"address": "29130 Cliffside Dr, Malibu, CA 90265, USA"
|
||||
},
|
||||
"ratingsAverage": 3.9,
|
||||
"ratingsQuantity": 7,
|
||||
"images": ["tour-6-1.jpg", "tour-6-2.jpg", "tour-6-3.jpg"],
|
||||
"startDates": [
|
||||
"2021-07-19T09:00:00.000Z",
|
||||
"2021-09-06T09:00:00.000Z",
|
||||
"2022-03-18T10:00:00.000Z"
|
||||
],
|
||||
"_id": "5c88fa8cf4afda39709c2966",
|
||||
"name": "The Sports Lover",
|
||||
"duration": 14,
|
||||
"maxGroupSize": 8,
|
||||
"difficulty": "difficult",
|
||||
"guides": [
|
||||
"5c8a21f22f8fb814b56fa18a",
|
||||
"5c8a1f292f8fb814b56fa184",
|
||||
"5c8a1f4e2f8fb814b56fa185"
|
||||
],
|
||||
"price": 2997,
|
||||
"summary": "Surfing, skating, parajumping, rock climbing and more, all in one tour",
|
||||
"description": "Nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\nVoluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur!",
|
||||
"imageCover": "tour-6-cover.jpg",
|
||||
"locations": [
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c296b",
|
||||
"description": "Point Dume Beach",
|
||||
"type": "Point",
|
||||
"coordinates": [-118.809361, 34.003098],
|
||||
"day": 1
|
||||
},
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c296a",
|
||||
"description": "Venice Skate Park",
|
||||
"type": "Point",
|
||||
"coordinates": [-118.47549, 33.987367],
|
||||
"day": 4
|
||||
},
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c2969",
|
||||
"description": "San Diego Skydive",
|
||||
"type": "Point",
|
||||
"coordinates": [-116.830104, 33.022843],
|
||||
"day": 6
|
||||
},
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c2968",
|
||||
"description": "Kern River Rafting",
|
||||
"type": "Point",
|
||||
"coordinates": [-118.4547, 35.710359],
|
||||
"day": 7
|
||||
},
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c2967",
|
||||
"description": "Yosemite National Park",
|
||||
"type": "Point",
|
||||
"coordinates": [-119.600492, 37.742371],
|
||||
"day": 10
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"startLocation": {
|
||||
"description": "Utah, USA",
|
||||
"type": "Point",
|
||||
"coordinates": [-109.55099, 37.283469],
|
||||
"address": "Bluff, UT 84512, USA"
|
||||
},
|
||||
"ratingsAverage": 4.8,
|
||||
"ratingsQuantity": 6,
|
||||
"images": ["tour-8-1.jpg", "tour-8-2.jpg", "tour-8-3.jpg"],
|
||||
"startDates": [
|
||||
"2021-03-23T10:00:00.000Z",
|
||||
"2021-10-25T09:00:00.000Z",
|
||||
"2022-01-30T10:00:00.000Z"
|
||||
],
|
||||
"_id": "5c88fa8cf4afda39709c2970",
|
||||
"name": "The Star Gazer",
|
||||
"duration": 9,
|
||||
"maxGroupSize": 8,
|
||||
"difficulty": "medium",
|
||||
"guides": ["5c8a21d02f8fb814b56fa189", "5c8a1f292f8fb814b56fa184"],
|
||||
"price": 2997,
|
||||
"summary": "The most remote and stunningly beautiful places for seeing the night sky",
|
||||
"description": "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\nLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
||||
"imageCover": "tour-8-cover.jpg",
|
||||
"locations": [
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c2973",
|
||||
"description": "Natural Bridges National Monument",
|
||||
"type": "Point",
|
||||
"coordinates": [-109.99953, 37.629017],
|
||||
"day": 1
|
||||
},
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c2972",
|
||||
"description": "Horseshoe Bend",
|
||||
"type": "Point",
|
||||
"coordinates": [-111.50954, 36.883269],
|
||||
"day": 3
|
||||
},
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c2971",
|
||||
"description": "Death Valley National Park",
|
||||
"type": "Point",
|
||||
"coordinates": [-117.07399, 36.501435],
|
||||
"day": 6
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"startLocation": {
|
||||
"description": "Yellowknife, CAN",
|
||||
"type": "Point",
|
||||
"coordinates": [-114.406097, 62.439943],
|
||||
"address": "Yellowknife, NT X1A 2L2, Canada"
|
||||
},
|
||||
"ratingsAverage": 4.7,
|
||||
"ratingsQuantity": 7,
|
||||
"images": ["tour-9-1.jpg", "tour-9-2.jpg", "tour-9-3.jpg"],
|
||||
"startDates": [
|
||||
"2021-12-16T10:00:00.000Z",
|
||||
"2022-01-16T10:00:00.000Z",
|
||||
"2022-12-12T10:00:00.000Z"
|
||||
],
|
||||
"_id": "5c88fa8cf4afda39709c2974",
|
||||
"name": "The Northern Lights",
|
||||
"duration": 3,
|
||||
"maxGroupSize": 12,
|
||||
"difficulty": "easy",
|
||||
"guides": [
|
||||
"5c8a21f22f8fb814b56fa18a",
|
||||
"5c8a201e2f8fb814b56fa186",
|
||||
"5c8a23412f8fb814b56fa18c"
|
||||
],
|
||||
"price": 1497,
|
||||
"summary": "Enjoy the Northern Lights in one of the best places in the world",
|
||||
"description": "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua, ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum!\nDolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur, exercitation ullamco laboris nisi ut aliquip. Lorem ipsum dolor sit amet, consectetur adipisicing elit!",
|
||||
"imageCover": "tour-9-cover.jpg",
|
||||
"locations": [
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c2975",
|
||||
"description": "Yellowknife",
|
||||
"type": "Point",
|
||||
"coordinates": [-114.406097, 62.439943],
|
||||
"day": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"startLocation": {
|
||||
"description": "California, USA",
|
||||
"type": "Point",
|
||||
"coordinates": [-122.29286, 38.294065],
|
||||
"address": "560 Jefferson St, Napa, CA 94559, USA"
|
||||
},
|
||||
"ratingsAverage": 4.4,
|
||||
"ratingsQuantity": 7,
|
||||
"images": ["tour-7-1.jpg", "tour-7-2.jpg", "tour-7-3.jpg"],
|
||||
"startDates": [
|
||||
"2021-02-12T10:00:00.000Z",
|
||||
"2021-04-14T09:00:00.000Z",
|
||||
"2021-09-01T09:00:00.000Z"
|
||||
],
|
||||
"_id": "5c88fa8cf4afda39709c296c",
|
||||
"name": "The Wine Taster",
|
||||
"duration": 5,
|
||||
"maxGroupSize": 8,
|
||||
"difficulty": "easy",
|
||||
"guides": ["5c8a22c62f8fb814b56fa18b", "5c8a23412f8fb814b56fa18c"],
|
||||
"price": 1997,
|
||||
"summary": "Exquisite wines, scenic views, exclusive barrel tastings, and much more",
|
||||
"description": "Consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\nIrure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
|
||||
"imageCover": "tour-7-cover.jpg",
|
||||
"locations": [
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c296f",
|
||||
"description": "Beringer Vineyards",
|
||||
"type": "Point",
|
||||
"coordinates": [-122.479887, 38.510312],
|
||||
"day": 1
|
||||
},
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c296e",
|
||||
"description": "Clos Pegase Winery & Tasting Room",
|
||||
"type": "Point",
|
||||
"coordinates": [-122.582948, 38.585707],
|
||||
"day": 3
|
||||
},
|
||||
{
|
||||
"_id": "5c88fa8cf4afda39709c296d",
|
||||
"description": "Raymond Vineyard and Cellar",
|
||||
"type": "Point",
|
||||
"coordinates": [-122.434697, 38.482181],
|
||||
"day": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
182
4-natours/after-section-06/dev-data/data/users.json
Normal file
@@ -0,0 +1,182 @@
|
||||
[
|
||||
{
|
||||
"_id": "5c8a1d5b0190b214360dc057",
|
||||
"name": "Jonas Schmedtmann",
|
||||
"email": "admin@natours.io",
|
||||
"role": "admin",
|
||||
"active": true,
|
||||
"photo": "user-1.jpg",
|
||||
"password": "$2a$12$Q0grHjH9PXc6SxivC8m12.2mZJ9BbKcgFpwSG4Y1ZEII8HJVzWeyS"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a1dfa2f8fb814b56fa181",
|
||||
"name": "Lourdes Browning",
|
||||
"email": "loulou@example.com",
|
||||
"role": "user",
|
||||
"active": true,
|
||||
"photo": "user-2.jpg",
|
||||
"password": "$2a$12$hP1h2pnNp7wgyZNRwPsOTeZuNzWBv7vHmsR3DT/OaPSUBQT.y0S.."
|
||||
},
|
||||
{
|
||||
"_id": "5c8a1e1a2f8fb814b56fa182",
|
||||
"name": "Sophie Louise Hart",
|
||||
"email": "sophie@example.com",
|
||||
"role": "user",
|
||||
"active": true,
|
||||
"photo": "user-3.jpg",
|
||||
"password": "$2a$12$9nFqToiTmjgfFVJiQvjmreLt4k8X4gGYCETGapSZOb2hHa55t0dDq"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a1ec62f8fb814b56fa183",
|
||||
"name": "Ayla Cornell",
|
||||
"email": "ayls@example.com",
|
||||
"role": "user",
|
||||
"active": true,
|
||||
"photo": "user-4.jpg",
|
||||
"password": "$2a$12$tm33.M/4pfEbZF64WbFuHuVFv85v4qEhi.ik8njbud7yaoqCZpjiy"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a1f292f8fb814b56fa184",
|
||||
"name": "Leo Gillespie",
|
||||
"email": "leo@example.com",
|
||||
"role": "guide",
|
||||
"active": true,
|
||||
"photo": "user-5.jpg",
|
||||
"password": "$2a$12$OOPr90tBEBF1Iho3ox0Jde0O/WXUR0VLA5xdh6tWcu7qb.qOCvSg2"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a1f4e2f8fb814b56fa185",
|
||||
"name": "Jennifer Hardy",
|
||||
"email": "jennifer@example.com",
|
||||
"role": "guide",
|
||||
"active": true,
|
||||
"photo": "user-6.jpg",
|
||||
"password": "$2a$12$XCXvvlhRBJ8CydKH09v1v.jpg0hB9gVVfMVEoz4MsxqL9zb5PrF42"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a201e2f8fb814b56fa186",
|
||||
"name": "Kate Morrison",
|
||||
"email": "kate@example.com",
|
||||
"role": "guide",
|
||||
"active": true,
|
||||
"photo": "user-7.jpg",
|
||||
"password": "$2a$12$II1F3aBSFDF3Xz7iB4rk/.a2dogwkClMN5gGCWrRlILrG1xtJG7q6"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a20d32f8fb814b56fa187",
|
||||
"name": "Eliana Stout",
|
||||
"email": "eliana@example.com",
|
||||
"role": "user",
|
||||
"active": true,
|
||||
"photo": "user-8.jpg",
|
||||
"password": "$2a$12$Jb/ILhdDV.ZpnPMu19xfe.NRh5ntE2LzNMNcsty05QWwRbmFFVMKO"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a211f2f8fb814b56fa188",
|
||||
"name": "Cristian Vega",
|
||||
"email": "chris@example.com",
|
||||
"role": "user",
|
||||
"active": true,
|
||||
"photo": "user-9.jpg",
|
||||
"password": "$2a$12$r7/jtdWtzNfrfC7zw3uS.eDJ3Bs.8qrO31ZdbMljL.lUY0TAsaAL6"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a21d02f8fb814b56fa189",
|
||||
"name": "Steve T. Scaife",
|
||||
"email": "steve@example.com",
|
||||
"role": "lead-guide",
|
||||
"active": true,
|
||||
"photo": "user-10.jpg",
|
||||
"password": "$2a$12$q7v9dm.S4DvqhAeBc4KwduedEDEkDe2GGFGzteW6xnHt120oRpkqm"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a21f22f8fb814b56fa18a",
|
||||
"name": "Aarav Lynn",
|
||||
"email": "aarav@example.com",
|
||||
"role": "lead-guide",
|
||||
"active": true,
|
||||
"photo": "user-11.jpg",
|
||||
"password": "$2a$12$lKWhzujFvQwG4m/X3mnTneOB3ib9IYETsOqQ8aN5QEWDjX6X2wJJm"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a22c62f8fb814b56fa18b",
|
||||
"name": "Miyah Myles",
|
||||
"email": "miyah@example.com",
|
||||
"role": "lead-guide",
|
||||
"active": true,
|
||||
"photo": "user-12.jpg",
|
||||
"password": "$2a$12$.XIvvmznHQSa9UOI639yhe4vzHKCYO1vpTUZc4d45oiT4GOZQe1kS"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a23412f8fb814b56fa18c",
|
||||
"name": "Ben Hadley",
|
||||
"email": "ben@example.com",
|
||||
"role": "guide",
|
||||
"active": true,
|
||||
"photo": "user-13.jpg",
|
||||
"password": "$2a$12$D3fyuS9ETdBBw5lOwceTMuZcDTyVq28ieeGUAanIuLMcSDz6bpfIe"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a23c82f8fb814b56fa18d",
|
||||
"name": "Laura Wilson",
|
||||
"email": "laura@example.com",
|
||||
"role": "user",
|
||||
"active": true,
|
||||
"photo": "user-14.jpg",
|
||||
"password": "$2a$12$VPYaAAOsI44uhq11WbZ5R.cHT4.fGdlI9gKJd95jmYw3.sAsmbvBq"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a23de2f8fb814b56fa18e",
|
||||
"name": "Max Smith",
|
||||
"email": "max@example.com",
|
||||
"role": "user",
|
||||
"active": true,
|
||||
"photo": "user-15.jpg",
|
||||
"password": "$2a$12$l5qamwqcqC2NlgN6o5A5..9Fxzr6X.bjx/8j3a9jYUHWGOL99oXlm"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a24282f8fb814b56fa18f",
|
||||
"name": "Isabel Kirkland",
|
||||
"email": "isabel@example.com",
|
||||
"role": "user",
|
||||
"active": true,
|
||||
"photo": "user-16.jpg",
|
||||
"password": "$2a$12$IUnwPH0MGFeMuz7g4gtfvOll.9wgLyxG.9C3TKlttfLtCQWEE6GIu"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a24402f8fb814b56fa190",
|
||||
"name": "Alexander Jones",
|
||||
"email": "alex@example.com",
|
||||
"role": "user",
|
||||
"active": true,
|
||||
"photo": "user-17.jpg",
|
||||
"password": "$2a$12$NnclhoYFNcSApoQ3ML8kk.b4B3gbpOmZJLfqska07miAnXukOgK6y"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a245f2f8fb814b56fa191",
|
||||
"name": "Eduardo Hernandez",
|
||||
"email": "edu@example.com",
|
||||
"role": "user",
|
||||
"active": true,
|
||||
"photo": "user-18.jpg",
|
||||
"password": "$2a$12$uB5H1OxLMOqDYTuTlptAoewlovENJvjrLwzsL1wUZ6OkAIByPPBGq"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a24822f8fb814b56fa192",
|
||||
"name": "John Riley",
|
||||
"email": "john@example.com",
|
||||
"role": "user",
|
||||
"active": true,
|
||||
"photo": "user-19.jpg",
|
||||
"password": "$2a$12$11JElTatQlAFo1Obw/dwd..vuVmQyYS7MT14pkl3lRvVPjGA00G8O"
|
||||
},
|
||||
{
|
||||
"_id": "5c8a24a02f8fb814b56fa193",
|
||||
"name": "Lisa Brown",
|
||||
"email": "lisa@example.com",
|
||||
"role": "user",
|
||||
"active": true,
|
||||
"photo": "user-20.jpg",
|
||||
"password": "$2a$12$uA9FsDw63v6dkJKGlLQ/8ufYBs8euB7kqIQewyYlZXU5azEKeLEky"
|
||||
}
|
||||
]
|
||||
BIN
4-natours/after-section-06/dev-data/img/aarav.jpg
Normal file
|
After Width: | Height: | Size: 316 KiB |
BIN
4-natours/after-section-06/dev-data/img/leo.jpg
Normal file
|
After Width: | Height: | Size: 202 KiB |
BIN
4-natours/after-section-06/dev-data/img/monica.jpg
Normal file
|
After Width: | Height: | Size: 146 KiB |
BIN
4-natours/after-section-06/dev-data/img/new-tour-1.jpg
Normal file
|
After Width: | Height: | Size: 1.8 MiB |
BIN
4-natours/after-section-06/dev-data/img/new-tour-2.jpg
Normal file
|
After Width: | Height: | Size: 2.2 MiB |
BIN
4-natours/after-section-06/dev-data/img/new-tour-3.jpg
Normal file
|
After Width: | Height: | Size: 864 KiB |
BIN
4-natours/after-section-06/dev-data/img/new-tour-4.jpg
Normal file
|
After Width: | Height: | Size: 2.8 MiB |
@@ -0,0 +1,6 @@
|
||||
main.main
|
||||
.error
|
||||
.error__title
|
||||
h2.heading-secondary.heading-secondary--error Uh oh! Something went wrong!
|
||||
h2.error__emoji 😢 🤯
|
||||
.error__msg Page not found!
|
||||
@@ -0,0 +1,12 @@
|
||||
main.main
|
||||
.login-form
|
||||
h2.heading-secondary.ma-bt-lg Log into your account
|
||||
form.form
|
||||
.form__group
|
||||
label.form__label(for='email') Email address
|
||||
input#email.form__input(type='email', placeholder='you@example.com', required)
|
||||
.form__group.ma-bt-md
|
||||
label.form__label(for='password') Password
|
||||
input#password.form__input(type='password', placeholder='••••••••', required, minlength='8')
|
||||
.form__group
|
||||
button.btn.btn--green Login
|
||||
@@ -0,0 +1,37 @@
|
||||
.card
|
||||
.card__header
|
||||
.card__picture
|
||||
.card__picture-overlay
|
||||
img.card__picture-img(src='img/tour-1-cover.jpg', alt='Tour 1')
|
||||
h3.heading-tertirary
|
||||
span The Forest Hiker
|
||||
|
||||
.card__details
|
||||
h4.card__sub-heading Easy 5-day tour
|
||||
p.card__text Breathtaking hike through the Canadian Banff National Park
|
||||
.card__data
|
||||
svg.card__icon
|
||||
use(xlink:href='img/icons.svg#icon-map-pin')
|
||||
span Banff, Canada
|
||||
.card__data
|
||||
svg.card__icon
|
||||
use(xlink:href='img/icons.svg#icon-calendar')
|
||||
span April 2021
|
||||
.card__data
|
||||
svg.card__icon
|
||||
use(xlink:href='img/icons.svg#icon-flag')
|
||||
|
|
||||
span 3 stops
|
||||
.card__data
|
||||
svg.card__icon
|
||||
use(xlink:href='img/icons.svg#icon-user')
|
||||
span 25 people
|
||||
|
||||
.card__footer
|
||||
p
|
||||
span.card__footer-value $297
|
||||
span.card__footer-text per person
|
||||
p.card__ratings
|
||||
span.card__footer-value 4.9
|
||||
span.card__footer-text rating (21)
|
||||
a.btn.btn--green.btn--small(href='#') Details
|
||||
105
4-natours/after-section-06/dev-data/templates/tourTemplate.pug
Normal file
@@ -0,0 +1,105 @@
|
||||
section.section-header
|
||||
.header__hero
|
||||
.header__hero-overlay
|
||||
img.header__hero-img(src='/img/tour-5-cover.jpg', alt='Tour 5')
|
||||
|
||||
.heading-box
|
||||
h1.heading-primary
|
||||
span The Park Camper Tour
|
||||
.heading-box__group
|
||||
.heading-box__detail
|
||||
svg.heading-box__icon
|
||||
use(xlink:href='/img/icons.svg#icon-clock')
|
||||
span.heading-box__text 10 days
|
||||
.heading-box__detail
|
||||
svg.heading-box__icon
|
||||
use(xlink:href='/img/icons.svg#icon-map-pin')
|
||||
span.heading-box__text Las Vegas, USA
|
||||
|
||||
section.section-description
|
||||
.overview-box
|
||||
div
|
||||
.overview-box__group
|
||||
h2.heading-secondary.ma-bt-lg Quick facts
|
||||
.overview-box__detail
|
||||
svg.overview-box__icon
|
||||
use(xlink:href='/img/icons.svg#icon-calendar')
|
||||
span.overview-box__label Next date
|
||||
span.overview-box__text August 2021
|
||||
.overview-box__detail
|
||||
svg.overview-box__icon
|
||||
use(xlink:href='/img/icons.svg#icon-trending-up')
|
||||
span.overview-box__label Difficulty
|
||||
span.overview-box__text Medium
|
||||
.overview-box__detail
|
||||
svg.overview-box__icon
|
||||
use(xlink:href='/img/icons.svg#icon-user')
|
||||
span.overview-box__label Participants
|
||||
span.overview-box__text 10 people
|
||||
.overview-box__detail
|
||||
svg.overview-box__icon
|
||||
use(xlink:href='/img/icons.svg#icon-star')
|
||||
span.overview-box__label Rating
|
||||
span.overview-box__text 4.9 / 5
|
||||
|
||||
.overview-box__group
|
||||
h2.heading-secondary.ma-bt-lg Your tour guides
|
||||
.overview-box__detail
|
||||
img.overview-box__img(src='/img/users/user-19.jpg', alt='Lead guide')
|
||||
span.overview-box__label Lead guide
|
||||
span.overview-box__text Steven Miller
|
||||
.overview-box__detail
|
||||
img.overview-box__img(src='/img/users/user-18.jpg', alt='Tour guide')
|
||||
span.overview-box__label Tour guide
|
||||
span.overview-box__text Lisa Brown
|
||||
.overview-box__detail
|
||||
img.overview-box__img(src='/img/users/user-17.jpg', alt='Intern')
|
||||
span.overview-box__label Intern
|
||||
span.overview-box__text Max Smith
|
||||
|
||||
.description-box
|
||||
h2.heading-secondary.ma-bt-lg About the park camper tour
|
||||
p.description__text Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
||||
p.description__text Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum!
|
||||
|
||||
section.section-pictures
|
||||
.picture-box
|
||||
img.picture-box__img.picture-box__img--1(src='/img/tour-5-1.jpg', alt='The Park Camper Tour 1')
|
||||
.picture-box
|
||||
img.picture-box__img.picture-box__img--2(src='/img/tour-5-2.jpg', alt='The Park Camper Tour 1')
|
||||
.picture-box
|
||||
img.picture-box__img.picture-box__img--3(src='/img/tour-5-3.jpg', alt='The Park Camper Tour 1')
|
||||
|
||||
section.section-map
|
||||
#map
|
||||
|
||||
section.section-reviews
|
||||
.reviews
|
||||
|
||||
.reviews__card
|
||||
.reviews__avatar
|
||||
img.reviews__avatar-img(src='/img/users/user-7.jpg', alt='Jim Brown')
|
||||
h6.reviews__user Jim Brown
|
||||
p.reviews__text Lorem ipsum dolor sit amet consectetur adipisicing elit. Cumque dignissimos sint quo commodi corrupti accusantium veniam saepe numquam.
|
||||
.reviews__rating
|
||||
svg.reviews__star.reviews__star--active
|
||||
use(xlink:href='/img/icons.svg#icon-star')
|
||||
svg.reviews__star.reviews__star--active
|
||||
use(xlink:href='/img/icons.svg#icon-star')
|
||||
svg.reviews__star.reviews__star--active
|
||||
use(xlink:href='/img/icons.svg#icon-star')
|
||||
svg.reviews__star.reviews__star--active
|
||||
use(xlink:href='/img/icons.svg#icon-star')
|
||||
svg.reviews__star.reviews__star--active
|
||||
use(xlink:href='/img/icons.svg#icon-star')
|
||||
|
||||
section.section-cta
|
||||
.cta
|
||||
.cta__img.cta__img--logo
|
||||
img(src='/img/logo-white.png', alt='Natours logo')
|
||||
img.cta__img.cta__img--1(src='/img/tour-5-2.jpg', alt='')
|
||||
img.cta__img.cta__img--2(src='/img/tour-5-1.jpg', alt='')
|
||||
.cta__content
|
||||
h2.heading-secondary What are you waiting for?
|
||||
p.cta__text 10 days. 1 adventure. Infinite memories. Make it yours today!
|
||||
button.btn.btn--green.span-all-rows Book tour now!
|
||||
@@ -0,0 +1,77 @@
|
||||
main.main
|
||||
.user-view
|
||||
nav.user-view__menu
|
||||
ul.side-nav
|
||||
li.side-nav--active
|
||||
a(href='#')
|
||||
svg
|
||||
use(xlink:href='img/icons.svg#icon-settings')
|
||||
| Settings
|
||||
li
|
||||
a(href='#')
|
||||
svg
|
||||
use(xlink:href='img/icons.svg#icon-briefcase')
|
||||
| My bookings
|
||||
li
|
||||
a(href='#')
|
||||
svg
|
||||
use(xlink:href='img/icons.svg#icon-star')
|
||||
| My reviews
|
||||
li
|
||||
a(href='#')
|
||||
svg
|
||||
use(xlink:href='img/icons.svg#icon-credit-card')
|
||||
| Billing
|
||||
.admin-nav
|
||||
h5.admin-nav__heading Admin
|
||||
ul.side-nav
|
||||
li
|
||||
a(href='#')
|
||||
svg
|
||||
use(xlink:href='img/icons.svg#icon-map')
|
||||
| Manage tours
|
||||
li
|
||||
a(href='#')
|
||||
svg
|
||||
use(xlink:href='img/icons.svg#icon-users')
|
||||
| Manage users
|
||||
li
|
||||
a(href='#')
|
||||
svg
|
||||
use(xlink:href='img/icons.svg#icon-star')
|
||||
| Manage reviews
|
||||
li
|
||||
a(href='#')
|
||||
svg
|
||||
use(xlink:href='img/icons.svg#icon-briefcase')
|
||||
|
||||
.user-view__content
|
||||
.user-view__form-container
|
||||
h2.heading-secondary.ma-bt-md Your account settings
|
||||
form.form.form-user-data
|
||||
.form__group
|
||||
label.form__label(for='name') Name
|
||||
input#name.form__input(type='text', value='Jonas Schmedtmann', required)
|
||||
.form__group.ma-bt-md
|
||||
label.form__label(for='email') Email address
|
||||
input#email.form__input(type='email', value='admin@natours.io', required)
|
||||
.form__group.form__photo-upload
|
||||
img.form__user-photo(src='img/user.jpg', alt='User photo')
|
||||
a.btn-text(href='') Choose new photo
|
||||
.form__group.right
|
||||
button.btn.btn--small.btn--green Save settings
|
||||
.line
|
||||
.user-view__form-container
|
||||
h2.heading-secondary.ma-bt-md Password change
|
||||
form.form.form-user-settings
|
||||
.form__group
|
||||
label.form__label(for='password-current') Current password
|
||||
input#password-current.form__input(type='password', placeholder='••••••••', required, minlength='8')
|
||||
.form__group
|
||||
label.form__label(for='password') New password
|
||||
input#password.form__input(type='password', placeholder='••••••••', required, minlength='8')
|
||||
.form__group.ma-bt-lg
|
||||
label.form__label(for='password-confirm') Confirm password
|
||||
input#password-confirm.form__input(type='password', placeholder='••••••••', required, minlength='8')
|
||||
.form__group.right
|
||||
button.btn.btn--small.btn--green Save password
|
||||
1973
4-natours/after-section-06/package-lock.json
generated
Normal file
28
4-natours/after-section-06/package.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "natours",
|
||||
"version": "1.0.0",
|
||||
"description": "Learning node, express and mongoDB",
|
||||
"main": "app.js",
|
||||
"scripts": {
|
||||
"start:dev": "nodemon server.js",
|
||||
"start:prod": "NODE_ENV=production nodemon server.js"
|
||||
},
|
||||
"author": "Jonas Schmedtmann",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"dotenv": "^7.0.0",
|
||||
"express": "^4.16.4",
|
||||
"morgan": "^1.9.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^5.16.0",
|
||||
"eslint-config-airbnb": "^17.1.0",
|
||||
"eslint-config-prettier": "^4.1.0",
|
||||
"eslint-plugin-import": "^2.17.2",
|
||||
"eslint-plugin-jsx-a11y": "^6.2.1",
|
||||
"eslint-plugin-node": "^8.0.1",
|
||||
"eslint-plugin-prettier": "^3.0.1",
|
||||
"eslint-plugin-react": "^7.12.4",
|
||||
"prettier": "^1.17.0"
|
||||
}
|
||||
}
|
||||
1324
4-natours/after-section-06/public/css/style.css
Normal file
BIN
4-natours/after-section-06/public/img/favicon.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
1324
4-natours/after-section-06/public/img/icons.svg
Executable file
|
After Width: | Height: | Size: 141 KiB |
BIN
4-natours/after-section-06/public/img/logo-green-round.png
Normal file
|
After Width: | Height: | Size: 80 KiB |
BIN
4-natours/after-section-06/public/img/logo-green-small.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
4-natours/after-section-06/public/img/logo-green.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
4-natours/after-section-06/public/img/logo-white.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
4-natours/after-section-06/public/img/pin.png
Normal file
|
After Width: | Height: | Size: 8.0 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-1-1.jpg
Executable file
|
After Width: | Height: | Size: 647 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-1-2.jpg
Executable file
|
After Width: | Height: | Size: 837 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-1-3.jpg
Executable file
|
After Width: | Height: | Size: 717 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-1-cover.jpg
Normal file
|
After Width: | Height: | Size: 950 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-2-1.jpg
Executable file
|
After Width: | Height: | Size: 588 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-2-2.jpg
Executable file
|
After Width: | Height: | Size: 308 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-2-3.jpg
Executable file
|
After Width: | Height: | Size: 903 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-2-cover.jpg
Normal file
|
After Width: | Height: | Size: 776 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-3-1.jpg
Executable file
|
After Width: | Height: | Size: 256 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-3-2.jpg
Normal file
|
After Width: | Height: | Size: 675 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-3-3.jpg
Normal file
|
After Width: | Height: | Size: 563 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-3-cover.jpg
Normal file
|
After Width: | Height: | Size: 606 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-4-1.jpg
Executable file
|
After Width: | Height: | Size: 618 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-4-2.jpg
Executable file
|
After Width: | Height: | Size: 787 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-4-3.jpg
Executable file
|
After Width: | Height: | Size: 970 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-4-cover.jpg
Normal file
|
After Width: | Height: | Size: 574 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-5-1.jpg
Normal file
|
After Width: | Height: | Size: 718 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-5-2.jpg
Normal file
|
After Width: | Height: | Size: 298 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-5-3.jpg
Normal file
|
After Width: | Height: | Size: 539 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-5-cover.jpg
Normal file
|
After Width: | Height: | Size: 626 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-6-1.jpg
Executable file
|
After Width: | Height: | Size: 571 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-6-2.jpg
Executable file
|
After Width: | Height: | Size: 545 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-6-3.jpg
Executable file
|
After Width: | Height: | Size: 387 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-6-cover.jpg
Normal file
|
After Width: | Height: | Size: 853 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-7-1.jpg
Executable file
|
After Width: | Height: | Size: 436 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-7-2.jpg
Normal file
|
After Width: | Height: | Size: 607 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-7-3.jpg
Executable file
|
After Width: | Height: | Size: 432 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-7-cover.jpg
Executable file
|
After Width: | Height: | Size: 275 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-8-1.jpg
Executable file
|
After Width: | Height: | Size: 631 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-8-2.jpg
Executable file
|
After Width: | Height: | Size: 540 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-8-3.jpg
Normal file
|
After Width: | Height: | Size: 581 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-8-cover.jpg
Normal file
|
After Width: | Height: | Size: 669 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-9-1.jpg
Executable file
|
After Width: | Height: | Size: 467 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-9-2.jpg
Executable file
|
After Width: | Height: | Size: 483 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-9-3.jpg
Normal file
|
After Width: | Height: | Size: 502 KiB |
BIN
4-natours/after-section-06/public/img/tours/tour-9-cover.jpg
Executable file
|
After Width: | Height: | Size: 552 KiB |
BIN
4-natours/after-section-06/public/img/users/default.jpg
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
4-natours/after-section-06/public/img/users/user-1.jpg
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
4-natours/after-section-06/public/img/users/user-10.jpg
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
4-natours/after-section-06/public/img/users/user-11.jpg
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
4-natours/after-section-06/public/img/users/user-12.jpg
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
4-natours/after-section-06/public/img/users/user-13.jpg
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
4-natours/after-section-06/public/img/users/user-14.jpg
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
4-natours/after-section-06/public/img/users/user-15.jpg
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
BIN
4-natours/after-section-06/public/img/users/user-16.jpg
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
4-natours/after-section-06/public/img/users/user-17.jpg
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
4-natours/after-section-06/public/img/users/user-18.jpg
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
4-natours/after-section-06/public/img/users/user-19.jpg
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
4-natours/after-section-06/public/img/users/user-2.jpg
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
BIN
4-natours/after-section-06/public/img/users/user-20.jpg
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
4-natours/after-section-06/public/img/users/user-3.jpg
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
4-natours/after-section-06/public/img/users/user-4.jpg
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
4-natours/after-section-06/public/img/users/user-5.jpg
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
4-natours/after-section-06/public/img/users/user-6.jpg
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
4-natours/after-section-06/public/img/users/user-7.jpg
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
4-natours/after-section-06/public/img/users/user-8.jpg
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
4-natours/after-section-06/public/img/users/user-9.jpg
Normal file
|
After Width: | Height: | Size: 18 KiB |
430
4-natours/after-section-06/public/overview.html
Normal file
@@ -0,0 +1,430 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css?family=Lato:300,300i,700"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
|
||||
<link rel="stylesheet" href="css/style.css" />
|
||||
<link rel="shortcut icon" type="image/png" href="img/favicon.png" />
|
||||
|
||||
<title>Natours | Exciting tours for adventurous people</title>
|
||||
</head>
|
||||
<body>
|
||||
<header class="header">
|
||||
<nav class="nav nav--tours">
|
||||
<a href="#" class="nav__el">All tours</a>
|
||||
<form class="nav__search">
|
||||
<button class="nav__search-btn">
|
||||
<svg>
|
||||
<use xlink:href="img/icons.svg#icon-search"></use>
|
||||
</svg>
|
||||
</button>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Search tours"
|
||||
class="nav__search-input"
|
||||
/>
|
||||
</form>
|
||||
</nav>
|
||||
<div class="header__logo">
|
||||
<img src="img/logo-white.png" alt="Natours logo" />
|
||||
</div>
|
||||
<nav class="nav nav--user">
|
||||
<a href="#" class="nav__el">My bookings</a>
|
||||
<a href="#" class="nav__el">
|
||||
<img src="img/user.jpg" alt="User photo" class="nav__user-img" />
|
||||
<span>Jonas</span>
|
||||
</a>
|
||||
|
||||
<!-- <button class="nav__el">Log in</button>
|
||||
<button class="nav__el nav__el--cta">Sign up</button> -->
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<section class="overview">
|
||||
<div class="card-container">
|
||||
<div class="card">
|
||||
<div class="card__header">
|
||||
<div class="card__picture">
|
||||
<div class="card__picture-overlay"> </div>
|
||||
<img
|
||||
src="img/tour-1-cover.jpg"
|
||||
alt="Tour 1"
|
||||
class="card__picture-img"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<h3 class="heading-tertirary">
|
||||
<span>The Forest Hiker</span>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="card__details">
|
||||
<h4 class="card__sub-heading">Easy 5-day tour</h4>
|
||||
<p class="card__text">
|
||||
Breathtaking hike through the Canadian Banff National Park
|
||||
</p>
|
||||
<div class="card__data">
|
||||
<svg class="card__icon">
|
||||
<use xlink:href="img/icons.svg#icon-map-pin"></use>
|
||||
</svg>
|
||||
<span>Banff, Canada</span>
|
||||
</div>
|
||||
<div class="card__data">
|
||||
<svg class="card__icon">
|
||||
<use xlink:href="img/icons.svg#icon-calendar"></use>
|
||||
</svg>
|
||||
<span>April 2021</span>
|
||||
</div>
|
||||
<div class="card__data">
|
||||
<svg class="card__icon">
|
||||
<use xlink:href="img/icons.svg#icon-flag"></use>
|
||||
</svg>
|
||||
<span>3 stops</span>
|
||||
</div>
|
||||
<div class="card__data">
|
||||
<svg class="card__icon">
|
||||
<use xlink:href="img/icons.svg#icon-user"></use>
|
||||
</svg>
|
||||
<span>25 people</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card__footer">
|
||||
<p>
|
||||
<span class="card__footer-value">$297</span>
|
||||
<span class="card__footer-text">per person</span>
|
||||
</p>
|
||||
<p class="card__ratings">
|
||||
<span class="card__footer-value">4.9</span>
|
||||
<span class="card__footer-text">rating (21)</span>
|
||||
</p>
|
||||
<a href="#" class="btn btn--green btn--small">Details</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card__header">
|
||||
<div class="card__picture">
|
||||
<div class="card__picture-overlay"> </div>
|
||||
<img
|
||||
src="img/tour-2-cover.jpg"
|
||||
alt="Tour 1"
|
||||
class="card__picture-img"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<h3 class="heading-tertirary">
|
||||
<span>The Sea Explorer</span>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="card__details">
|
||||
<h4 class="card__sub-heading">Medium-difficult 7-day tour</h4>
|
||||
<p class="card__text">
|
||||
Exploring the jaw-dropping US east coast by foot and by boat
|
||||
</p>
|
||||
<div class="card__data">
|
||||
<svg class="card__icon">
|
||||
<use xlink:href="img/icons.svg#icon-map-pin"></use>
|
||||
</svg>
|
||||
<span>Oregon, US</span>
|
||||
</div>
|
||||
<div class="card__data">
|
||||
<svg class="card__icon">
|
||||
<use xlink:href="img/icons.svg#icon-calendar"></use>
|
||||
</svg>
|
||||
<span>June 2021</span>
|
||||
</div>
|
||||
<div class="card__data">
|
||||
<svg class="card__icon">
|
||||
<use xlink:href="img/icons.svg#icon-flag"></use>
|
||||
</svg>
|
||||
<span>4 stops</span>
|
||||
</div>
|
||||
<div class="card__data">
|
||||
<svg class="card__icon">
|
||||
<use xlink:href="img/icons.svg#icon-user"></use>
|
||||
</svg>
|
||||
<span>15 people</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card__footer">
|
||||
<p>
|
||||
<span class="card__footer-value">$497</span>
|
||||
<span class="card__footer-text">per person</span>
|
||||
</p>
|
||||
<p class="card__ratings">
|
||||
<span class="card__footer-value">4.8</span>
|
||||
<span class="card__footer-text">rating (12)</span>
|
||||
</p>
|
||||
<a href="#" class="btn btn--green btn--small">Details</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card__header">
|
||||
<div class="card__picture">
|
||||
<div class="card__picture-overlay"> </div>
|
||||
<img
|
||||
src="img/tour-3-cover.jpg"
|
||||
alt="Tour 1"
|
||||
class="card__picture-img"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<h3 class="heading-tertirary">
|
||||
<span>The Snow Adventurer</span>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="card__details">
|
||||
<h4 class="card__sub-heading">Difficult 3-day tour</h4>
|
||||
<p class="card__text">
|
||||
Exciting adventure in the snow with snowboarding and skiing
|
||||
</p>
|
||||
<div class="card__data">
|
||||
<svg class="card__icon">
|
||||
<use xlink:href="img/icons.svg#icon-map-pin"></use>
|
||||
</svg>
|
||||
<span>Aspen, USA</span>
|
||||
</div>
|
||||
<div class="card__data">
|
||||
<svg class="card__icon">
|
||||
<use xlink:href="img/icons.svg#icon-calendar"></use>
|
||||
</svg>
|
||||
<span>January 2022</span>
|
||||
</div>
|
||||
<div class="card__data">
|
||||
<svg class="card__icon">
|
||||
<use xlink:href="img/icons.svg#icon-flag"></use>
|
||||
</svg>
|
||||
<span>2 stops</span>
|
||||
</div>
|
||||
<div class="card__data">
|
||||
<svg class="card__icon">
|
||||
<use xlink:href="img/icons.svg#icon-user"></use>
|
||||
</svg>
|
||||
<span>10 people</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card__footer">
|
||||
<p>
|
||||
<span class="card__footer-value">$697</span>
|
||||
<span class="card__footer-text">per person</span>
|
||||
</p>
|
||||
<p class="card__ratings">
|
||||
<span class="card__footer-value">4.9</span>
|
||||
<span class="card__footer-text">rating (7)</span>
|
||||
</p>
|
||||
<a href="#" class="btn btn--green btn--small">Details</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card__header">
|
||||
<div class="card__picture">
|
||||
<div class="card__picture-overlay"> </div>
|
||||
<img
|
||||
src="img/tour-4-cover.jpg"
|
||||
alt="Tour 1"
|
||||
class="card__picture-img"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<h3 class="heading-tertirary">
|
||||
<span>The City Wanderer</span>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="card__details">
|
||||
<h4 class="card__sub-heading">Easy 7-day tour</h4>
|
||||
<p class="card__text">
|
||||
Living the life of Wanderlust in the US' most beatiful cities
|
||||
</p>
|
||||
<div class="card__data">
|
||||
<svg class="card__icon">
|
||||
<use xlink:href="img/icons.svg#icon-map-pin"></use>
|
||||
</svg>
|
||||
<span>NYC, USA</span>
|
||||
</div>
|
||||
<div class="card__data">
|
||||
<svg class="card__icon">
|
||||
<use xlink:href="img/icons.svg#icon-calendar"></use>
|
||||
</svg>
|
||||
<span>March 2021</span>
|
||||
</div>
|
||||
<div class="card__data">
|
||||
<svg class="card__icon">
|
||||
<use xlink:href="img/icons.svg#icon-flag"></use>
|
||||
</svg>
|
||||
<span>3 stops</span>
|
||||
</div>
|
||||
<div class="card__data">
|
||||
<svg class="card__icon">
|
||||
<use xlink:href="img/icons.svg#icon-user"></use>
|
||||
</svg>
|
||||
<span>20 people</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card__footer">
|
||||
<p>
|
||||
<span class="card__footer-value">$997</span>
|
||||
<span class="card__footer-text">per person</span>
|
||||
</p>
|
||||
<p class="card__ratings">
|
||||
<span class="card__footer-value">4.8</span>
|
||||
<span class="card__footer-text">rating (31)</span>
|
||||
</p>
|
||||
<a href="#" class="btn btn--green btn--small">Details</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card__header">
|
||||
<div class="card__picture">
|
||||
<div class="card__picture-overlay"> </div>
|
||||
<img
|
||||
src="img/tour-5-cover.jpg"
|
||||
alt="Tour 1"
|
||||
class="card__picture-img"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<h3 class="heading-tertirary">
|
||||
<span>The Park Camper</span>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="card__details">
|
||||
<h4 class="card__sub-heading">Medium-Difficult 10-day tour</h4>
|
||||
<p class="card__text">
|
||||
Breathing in Nature in America's most spectacular National Parks
|
||||
</p>
|
||||
<div class="card__data">
|
||||
<svg class="card__icon">
|
||||
<use xlink:href="img/icons.svg#icon-map-pin"></use>
|
||||
</svg>
|
||||
<span>Las Vegas, USA</span>
|
||||
</div>
|
||||
<div class="card__data">
|
||||
<svg class="card__icon">
|
||||
<use xlink:href="img/icons.svg#icon-calendar"></use>
|
||||
</svg>
|
||||
<span>August 2021</span>
|
||||
</div>
|
||||
<div class="card__data">
|
||||
<svg class="card__icon">
|
||||
<use xlink:href="img/icons.svg#icon-flag"></use>
|
||||
</svg>
|
||||
<span>4 stops</span>
|
||||
</div>
|
||||
<div class="card__data">
|
||||
<svg class="card__icon">
|
||||
<use xlink:href="img/icons.svg#icon-user"></use>
|
||||
</svg>
|
||||
<span>15 people</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card__footer">
|
||||
<p>
|
||||
<span class="card__footer-value">$1,497</span>
|
||||
<span class="card__footer-text">per person</span>
|
||||
</p>
|
||||
<p class="card__ratings">
|
||||
<span class="card__footer-value">4.9</span>
|
||||
<span class="card__footer-text">rating (19)</span>
|
||||
</p>
|
||||
<a href="/tour.html" class="btn btn--green btn--small">Details</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card__header">
|
||||
<div class="card__picture">
|
||||
<div class="card__picture-overlay"> </div>
|
||||
<img
|
||||
src="img/tour-6-cover.jpg"
|
||||
alt="Tour 1"
|
||||
class="card__picture-img"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<h3 class="heading-tertirary">
|
||||
<span>The Sports Lover</span>
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="card__details">
|
||||
<h4 class="card__sub-heading">Difficult 14-day tour</h4>
|
||||
<p class="card__text">
|
||||
Surfing, skating, parajumping, rock climbing and more, all in one
|
||||
tour
|
||||
</p>
|
||||
<div class="card__data">
|
||||
<svg class="card__icon">
|
||||
<use xlink:href="img/icons.svg#icon-map-pin"></use>
|
||||
</svg>
|
||||
<span>California, USA</span>
|
||||
</div>
|
||||
<div class="card__data">
|
||||
<svg class="card__icon">
|
||||
<use xlink:href="img/icons.svg#icon-calendar"></use>
|
||||
</svg>
|
||||
<span>July 2021</span>
|
||||
</div>
|
||||
<div class="card__data">
|
||||
<svg class="card__icon">
|
||||
<use xlink:href="img/icons.svg#icon-flag"></use>
|
||||
</svg>
|
||||
<span>5 stops</span>
|
||||
</div>
|
||||
<div class="card__data">
|
||||
<svg class="card__icon">
|
||||
<use xlink:href="img/icons.svg#icon-user"></use>
|
||||
</svg>
|
||||
<span>8 people</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card__footer">
|
||||
<p>
|
||||
<span class="card__footer-value">$1,997</span>
|
||||
<span class="card__footer-text">per person</span>
|
||||
</p>
|
||||
<p class="card__ratings">
|
||||
<span class="card__footer-value">4.7</span>
|
||||
<span class="card__footer-text">rating (23)</span>
|
||||
</p>
|
||||
<a href="#" class="btn btn--green btn--small">Details</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="footer">
|
||||
<div class="footer__logo">
|
||||
<img src="img/logo-green.png" alt="Natours logo" />
|
||||
</div>
|
||||
<ul class="footer__nav">
|
||||
<li><a href="#">About us</a></li>
|
||||
<li><a href="#">Download apps</a></li>
|
||||
<li><a href="#">Become a guide</a></li>
|
||||
<li><a href="#">Careers</a></li>
|
||||
<li><a href="#">Contact</a></li>
|
||||
</ul>
|
||||
<p class="footer__copyright">
|
||||
© by Jonas Schmedtmann. All rights reserved.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
522
4-natours/after-section-06/public/tour.html
Normal file
@@ -0,0 +1,522 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css?family=Lato:300,400,400i,700"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
|
||||
<link rel="stylesheet" href="css/style.css" />
|
||||
<link rel="shortcut icon" type="image/png" href="img/favicon.png" />
|
||||
|
||||
<title>Natours | The Park Camper Tour</title>
|
||||
|
||||
<script src="https://api.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.js"></script>
|
||||
<link
|
||||
href="https://api.mapbox.com/mapbox-gl-js/v0.50.0/mapbox-gl.css"
|
||||
rel="stylesheet"
|
||||
/>
|
||||
</head>
|
||||
<body>
|
||||
<header class="header">
|
||||
<nav class="nav nav--tours">
|
||||
<a href="/overview.html" class="nav__el">All tours</a>
|
||||
<form class="nav__search">
|
||||
<button class="nav__search-btn">
|
||||
<svg>
|
||||
<use xlink:href="img/icons.svg#icon-search"></use>
|
||||
</svg>
|
||||
</button>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Search tours"
|
||||
class="nav__search-input"
|
||||
/>
|
||||
</form>
|
||||
</nav>
|
||||
<div class="header__logo">
|
||||
<img src="img/logo-white.png" alt="Natours logo" />
|
||||
</div>
|
||||
<nav class="nav nav--user">
|
||||
<a href="#" class="nav__el">My bookings</a>
|
||||
<button class="nav__el">Log out</button>
|
||||
<a href="#" class="nav__el">
|
||||
<img src="img/user.jpg" alt="User photo" class="nav__user-img" />
|
||||
<span>Jonas</span>
|
||||
</a>
|
||||
|
||||
<!--
|
||||
<button class="nav__el">Log in</button>
|
||||
<button class="nav__el nav__el--cta">Sign up</button>
|
||||
-->
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<section class="section-header">
|
||||
<div class="heading-box">
|
||||
<h1 class="heading-primary">
|
||||
<span
|
||||
>The Park <br />
|
||||
Camper Tour</span
|
||||
>
|
||||
</h1>
|
||||
<div class="heading-box__group">
|
||||
<div class="heading-box__detail">
|
||||
<svg class="heading-box__icon">
|
||||
<use xlink:href="img/icons.svg#icon-clock"></use>
|
||||
</svg>
|
||||
<span class="heading-box__text">10 days</span>
|
||||
</div>
|
||||
<div class="heading-box__detail">
|
||||
<svg class="heading-box__icon">
|
||||
<use xlink:href="img/icons.svg#icon-map-pin"></use>
|
||||
</svg>
|
||||
<span class="heading-box__text">Las Vegas, USA</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section-description">
|
||||
<div class="overview-box">
|
||||
<div>
|
||||
<div class="overview-box__group">
|
||||
<h2 class="heading-secondary ma-bt-lg">Quick facts</h2>
|
||||
<div class="overview-box__detail">
|
||||
<svg class="overview-box__icon">
|
||||
<use xlink:href="img/icons.svg#icon-calendar"></use>
|
||||
</svg>
|
||||
<span class="overview-box__label">Next date</span>
|
||||
<span class="overview-box__text">August 2021</span>
|
||||
</div>
|
||||
<div class="overview-box__detail">
|
||||
<svg class="overview-box__icon">
|
||||
<use xlink:href="img/icons.svg#icon-trending-up"></use>
|
||||
</svg>
|
||||
<span class="overview-box__label">Difficulty</span>
|
||||
<span class="overview-box__text">Medium</span>
|
||||
</div>
|
||||
<div class="overview-box__detail">
|
||||
<svg class="overview-box__icon">
|
||||
<use xlink:href="img/icons.svg#icon-user"></use>
|
||||
</svg>
|
||||
<span class="overview-box__label">Participants</span>
|
||||
<span class="overview-box__text">10 people</span>
|
||||
</div>
|
||||
<div class="overview-box__detail">
|
||||
<svg class="overview-box__icon">
|
||||
<use xlink:href="img/icons.svg#icon-star"></use>
|
||||
</svg>
|
||||
<span class="overview-box__label">Rating</span>
|
||||
<span class="overview-box__text">4.9 / 5</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="overview-box__group">
|
||||
<h2 class="heading-secondary ma-bt-lg">Your tour guides</h2>
|
||||
|
||||
<div class="overview-box__detail">
|
||||
<img
|
||||
src="img/users/user-19.jpg"
|
||||
alt="Lead guide"
|
||||
class="overview-box__img"
|
||||
/>
|
||||
<span class="overview-box__label">Lead guide</span>
|
||||
<span class="overview-box__text">Steven Miller</span>
|
||||
</div>
|
||||
<div class="overview-box__detail">
|
||||
<img
|
||||
src="img/users/user-18.jpg"
|
||||
alt="Tour guide"
|
||||
class="overview-box__img"
|
||||
/>
|
||||
<span class="overview-box__label">Tour guide</span>
|
||||
<span class="overview-box__text">Lisa Brown</span>
|
||||
</div>
|
||||
<div class="overview-box__detail">
|
||||
<img
|
||||
src="img/users/user-17.jpg"
|
||||
alt="Intern"
|
||||
class="overview-box__img"
|
||||
/>
|
||||
<span class="overview-box__label">Intern</span>
|
||||
<span class="overview-box__text">Max Smith</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="description-box">
|
||||
<h2 class="heading-secondary ma-bt-lg">About the park camper tour</h2>
|
||||
<p class="description__text">
|
||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
|
||||
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
|
||||
minim veniam, quis nostrud exercitation ullamco laboris nisi ut
|
||||
aliquip ex ea commodo consequat. Duis aute irure dolor in
|
||||
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
|
||||
pariatur.
|
||||
</p>
|
||||
<p class="description__text">
|
||||
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
|
||||
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
|
||||
proident, sunt in culpa qui officia deserunt mollit anim id est
|
||||
laborum!
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section-pictures">
|
||||
<div class="picture-box">
|
||||
<img
|
||||
class="picture-box__img picture-box__img--1"
|
||||
src="img/tour-5-1.jpg"
|
||||
alt="The Park Camper Tour 1"
|
||||
/>
|
||||
</div>
|
||||
<div class="picture-box">
|
||||
<img
|
||||
class="picture-box__img picture-box__img--2"
|
||||
src="img/tour-5-2.jpg"
|
||||
alt="The Park Camper Tour 1"
|
||||
/>
|
||||
</div>
|
||||
<div class="picture-box">
|
||||
<img
|
||||
class="picture-box__img picture-box__img--3"
|
||||
src="img/tour-5-3.jpg"
|
||||
alt="The Park Camper Tour 1"
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section-map">
|
||||
<div id="map"></div>
|
||||
<script>
|
||||
mapboxgl.accessToken =
|
||||
'pk.eyJ1Ijoiam9uYXNzY2htZWR0bWFubiIsImEiOiJjam54ZmM5N3gwNjAzM3dtZDNxYTVlMnd2In0.ytpI7V7w7cyT1Kq5rT9Z1A';
|
||||
|
||||
const geojson = {
|
||||
type: 'FeatureCollection',
|
||||
features: [
|
||||
{
|
||||
type: 'Feature',
|
||||
geometry: {
|
||||
type: 'Point',
|
||||
coordinates: [-112.987418, 37.198125]
|
||||
},
|
||||
properties: {
|
||||
description: 'Zion Canyon National Park'
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'Feature',
|
||||
geometry: {
|
||||
type: 'Point',
|
||||
coordinates: [-111.376161, 36.86438]
|
||||
},
|
||||
properties: {
|
||||
description: 'Antelope Canyon'
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'Feature',
|
||||
geometry: {
|
||||
type: 'Point',
|
||||
coordinates: [-112.115763, 36.058973]
|
||||
},
|
||||
properties: {
|
||||
description: 'Grand Canyon National Park'
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'Feature',
|
||||
geometry: {
|
||||
type: 'Point',
|
||||
coordinates: [-116.107963, 34.011646]
|
||||
},
|
||||
properties: {
|
||||
description: 'Joshua Tree National Park'
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
const map = new mapboxgl.Map({
|
||||
container: 'map',
|
||||
style: 'mapbox://styles/jonasschmedtmann/cjnxfn3zk7bj52rpegdltx58h',
|
||||
scrollZoom: false
|
||||
});
|
||||
|
||||
const bounds = new mapboxgl.LngLatBounds();
|
||||
|
||||
geojson.features.forEach(function(marker) {
|
||||
var el = document.createElement('div');
|
||||
el.className = 'marker';
|
||||
|
||||
new mapboxgl.Marker({
|
||||
element: el,
|
||||
anchor: 'bottom'
|
||||
})
|
||||
.setLngLat(marker.geometry.coordinates)
|
||||
.addTo(map);
|
||||
|
||||
new mapboxgl.Popup({
|
||||
offset: 30,
|
||||
closeOnClick: false
|
||||
})
|
||||
.setLngLat(marker.geometry.coordinates)
|
||||
.setHTML('<p>' + marker.properties.description + '</p>')
|
||||
.addTo(map);
|
||||
|
||||
bounds.extend(marker.geometry.coordinates);
|
||||
});
|
||||
|
||||
map.fitBounds(bounds, {
|
||||
padding: {
|
||||
top: 200,
|
||||
bottom: 150,
|
||||
left: 50,
|
||||
right: 50
|
||||
}
|
||||
});
|
||||
|
||||
map.on('load', function() {
|
||||
map.addLayer({
|
||||
id: 'route',
|
||||
type: 'line',
|
||||
source: {
|
||||
type: 'geojson',
|
||||
data: {
|
||||
type: 'Feature',
|
||||
properties: {},
|
||||
geometry: {
|
||||
type: 'LineString',
|
||||
coordinates: [
|
||||
[-112.987418, 37.198125],
|
||||
[-111.376161, 36.86438],
|
||||
[-112.115763, 36.058973],
|
||||
[-116.107963, 34.011646]
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
layout: {
|
||||
'line-join': 'round',
|
||||
'line-cap': 'round'
|
||||
},
|
||||
paint: {
|
||||
'line-color': '#55c57a',
|
||||
'line-opacity': 0.6,
|
||||
'line-width': 3
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</section>
|
||||
|
||||
<section class="section-reviews">
|
||||
<div class="reviews">
|
||||
<div class="reviews__card">
|
||||
<div class="reviews__avatar">
|
||||
<img
|
||||
src="img/users/user-7.jpg"
|
||||
alt="Jim Brown"
|
||||
class="reviews__avatar-img"
|
||||
/>
|
||||
<h6 class="reviews__user">Jim Brown</h6>
|
||||
</div>
|
||||
<p class="reviews__text">
|
||||
Lorem ipsum dolor sit amet consectetur adipisicing elit. Cumque
|
||||
dignissimos sint quo commodi corrupti accusantium veniam saepe
|
||||
numquam.
|
||||
</p>
|
||||
<div class="reviews__rating">
|
||||
<svg class="reviews__star reviews__star--active">
|
||||
<use xlink:href="img/icons.svg#icon-star"></use>
|
||||
</svg>
|
||||
<svg class="reviews__star reviews__star--active">
|
||||
<use xlink:href="img/icons.svg#icon-star"></use>
|
||||
</svg>
|
||||
<svg class="reviews__star reviews__star--active">
|
||||
<use xlink:href="img/icons.svg#icon-star"></use>
|
||||
</svg>
|
||||
<svg class="reviews__star reviews__star--active">
|
||||
<use xlink:href="img/icons.svg#icon-star"></use>
|
||||
</svg>
|
||||
<svg class="reviews__star reviews__star--active">
|
||||
<use xlink:href="img/icons.svg#icon-star"></use>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="reviews__card">
|
||||
<div class="reviews__avatar">
|
||||
<img
|
||||
src="img/users/user-14.jpg"
|
||||
alt="Laura Wilson"
|
||||
class="reviews__avatar-img"
|
||||
/>
|
||||
<h6 class="reviews__user">Laura Wilson</h6>
|
||||
</div>
|
||||
<p class="reviews__text">
|
||||
Veniam adipisci blanditiis, corporis sit magnam aperiam ad, fuga
|
||||
reiciendis provident deleniti cumque similique itaque animi,
|
||||
sapiente obcaecati beatae accusantium.
|
||||
</p>
|
||||
<div class="reviews__rating">
|
||||
<svg class="reviews__star reviews__star--active">
|
||||
<use xlink:href="img/icons.svg#icon-star"></use>
|
||||
</svg>
|
||||
<svg class="reviews__star reviews__star--active">
|
||||
<use xlink:href="img/icons.svg#icon-star"></use>
|
||||
</svg>
|
||||
<svg class="reviews__star reviews__star--active">
|
||||
<use xlink:href="img/icons.svg#icon-star"></use>
|
||||
</svg>
|
||||
<svg class="reviews__star reviews__star--active">
|
||||
<use xlink:href="img/icons.svg#icon-star"></use>
|
||||
</svg>
|
||||
<svg class="reviews__star reviews__star--inactive">
|
||||
<use xlink:href="img/icons.svg#icon-star"></use>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="reviews__card">
|
||||
<div class="reviews__avatar">
|
||||
<img
|
||||
src="img/users/user-15.jpg"
|
||||
alt="Ben Hadley"
|
||||
class="reviews__avatar-img"
|
||||
/>
|
||||
<h6 class="reviews__user">Ben Hadley</h6>
|
||||
</div>
|
||||
<p class="reviews__text">
|
||||
Debitis, nesciunt itaque! At quis officia natus. Suscipit,
|
||||
reprehenderit blanditiis mollitia distinctio ducimus porro tempore
|
||||
perspiciatis sunt vel.
|
||||
</p>
|
||||
<div class="reviews__rating">
|
||||
<svg class="reviews__star reviews__star--active">
|
||||
<use xlink:href="img/icons.svg#icon-star"></use>
|
||||
</svg>
|
||||
<svg class="reviews__star reviews__star--active">
|
||||
<use xlink:href="img/icons.svg#icon-star"></use>
|
||||
</svg>
|
||||
<svg class="reviews__star reviews__star--active">
|
||||
<use xlink:href="img/icons.svg#icon-star"></use>
|
||||
</svg>
|
||||
<svg class="reviews__star reviews__star--active">
|
||||
<use xlink:href="img/icons.svg#icon-star"></use>
|
||||
</svg>
|
||||
<svg class="reviews__star reviews__star--active">
|
||||
<use xlink:href="img/icons.svg#icon-star"></use>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="reviews__card">
|
||||
<div class="reviews__avatar">
|
||||
<img
|
||||
src="img/users/user-6.jpg"
|
||||
alt="Alexander Jones"
|
||||
class="reviews__avatar-img"
|
||||
/>
|
||||
<h6 class="reviews__user">Alexander Jones</h6>
|
||||
</div>
|
||||
<p class="reviews__text">
|
||||
Quaerat laborum eveniet ut aut maiores doloribus mollitia aperiam
|
||||
quis praesentium sed inventore harum aliquam veritatis at adipisci
|
||||
ea assumenda!
|
||||
</p>
|
||||
<div class="reviews__rating">
|
||||
<svg class="reviews__star reviews__star--active">
|
||||
<use xlink:href="img/icons.svg#icon-star"></use>
|
||||
</svg>
|
||||
<svg class="reviews__star reviews__star--active">
|
||||
<use xlink:href="img/icons.svg#icon-star"></use>
|
||||
</svg>
|
||||
<svg class="reviews__star reviews__star--active">
|
||||
<use xlink:href="img/icons.svg#icon-star"></use>
|
||||
</svg>
|
||||
<svg class="reviews__star reviews__star--active">
|
||||
<use xlink:href="img/icons.svg#icon-star"></use>
|
||||
</svg>
|
||||
<svg class="reviews__star reviews__star--active">
|
||||
<use xlink:href="img/icons.svg#icon-star"></use>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="reviews__card">
|
||||
<div class="reviews__avatar">
|
||||
<img
|
||||
src="img/users/user-3.jpg"
|
||||
alt="Ayla Cornell"
|
||||
class="reviews__avatar-img"
|
||||
/>
|
||||
<h6 class="reviews__user">Ayla Cornell</h6>
|
||||
</div>
|
||||
<p class="reviews__text">
|
||||
Perferendis quo aliquid iste quas laboriosam molestias illo est
|
||||
voluptatem odit ea. Vero placeat culpa provident dicta maiores!
|
||||
</p>
|
||||
<div class="reviews__rating">
|
||||
<svg class="reviews__star reviews__star--active">
|
||||
<use xlink:href="img/icons.svg#icon-star"></use>
|
||||
</svg>
|
||||
<svg class="reviews__star reviews__star--active">
|
||||
<use xlink:href="img/icons.svg#icon-star"></use>
|
||||
</svg>
|
||||
<svg class="reviews__star reviews__star--active">
|
||||
<use xlink:href="img/icons.svg#icon-star"></use>
|
||||
</svg>
|
||||
<svg class="reviews__star reviews__star--active">
|
||||
<use xlink:href="img/icons.svg#icon-star"></use>
|
||||
</svg>
|
||||
<svg class="reviews__star reviews__star--active">
|
||||
<use xlink:href="img/icons.svg#icon-star"></use>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section-cta">
|
||||
<div class="cta">
|
||||
<div class="cta__img cta__img--logo">
|
||||
<img src="img/logo-white.png" alt="Natours logo" class="" />
|
||||
</div>
|
||||
<img src="img/tour-5-2.jpg" alt="" class="cta__img cta__img--1" />
|
||||
<img src="img/tour-5-1.jpg" alt="" class="cta__img cta__img--2" />
|
||||
|
||||
<div class="cta__content">
|
||||
<h2 class="heading-secondary">What are you waiting for?</h2>
|
||||
<p class="cta__text">
|
||||
10 days. 1 adventure. Infinite memories. Make it yours today!
|
||||
</p>
|
||||
<button class="btn btn--green span-all-rows">Book tour now!</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="footer">
|
||||
<div class="footer__logo">
|
||||
<img src="img/logo-green.png" alt="Natours logo" />
|
||||
</div>
|
||||
<ul class="footer__nav">
|
||||
<li><a href="#">About us</a></li>
|
||||
<li><a href="#">Download apps</a></li>
|
||||
<li><a href="#">Become a guide</a></li>
|
||||
<li><a href="#">Careers</a></li>
|
||||
<li><a href="#">Contact</a></li>
|
||||
</ul>
|
||||
<p class="footer__copyright">
|
||||
© by Jonas Schmedtmann. All rights reserved.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
19
4-natours/after-section-06/routes/tourRoutes.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const express = require('express');
|
||||
const tourController = require('./../controllers/tourController');
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.param('id', tourController.checkID);
|
||||
|
||||
router
|
||||
.route('/')
|
||||
.get(tourController.getAllTours)
|
||||
.post(tourController.checkBody, tourController.createTour);
|
||||
|
||||
router
|
||||
.route('/:id')
|
||||
.get(tourController.getTour)
|
||||
.patch(tourController.updateTour)
|
||||
.delete(tourController.deleteTour);
|
||||
|
||||
module.exports = router;
|
||||
17
4-natours/after-section-06/routes/userRoutes.js
Normal file
@@ -0,0 +1,17 @@
|
||||
const express = require('express');
|
||||
const userController = require('./../controllers/userController');
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router
|
||||
.route('/')
|
||||
.get(userController.getAllUsers)
|
||||
.post(userController.createUser);
|
||||
|
||||
router
|
||||
.route('/:id')
|
||||
.get(userController.getUser)
|
||||
.patch(userController.updateUser)
|
||||
.delete(userController.deleteUser);
|
||||
|
||||
module.exports = router;
|
||||
9
4-natours/after-section-06/server.js
Normal file
@@ -0,0 +1,9 @@
|
||||
const dotenv = require('dotenv');
|
||||
const app = require('./app');
|
||||
|
||||
dotenv.config({ path: './config.env' });
|
||||
|
||||
const port = process.env.PORT || 3000;
|
||||
app.listen(port, () => {
|
||||
console.log(`App running on port ${port}...`);
|
||||
});
|
||||
19
4-natours/after-section-08/.eslintrc.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"extends": ["airbnb", "prettier", "plugin:node/recommended"],
|
||||
"plugins": ["prettier"],
|
||||
"rules": {
|
||||
"prettier/prettier": "error",
|
||||
"spaced-comment": "off",
|
||||
"no-console": "warn",
|
||||
"consistent-return": "off",
|
||||
"func-names": "off",
|
||||
"object-shorthand": "off",
|
||||
"no-process-exit": "off",
|
||||
"no-param-reassign": "off",
|
||||
"no-return-await": "off",
|
||||
"no-underscore-dangle": "off",
|
||||
"class-methods-use-this": "off",
|
||||
"prefer-destructuring": ["error", { "object": true, "array": false }],
|
||||
"no-unused-vars": ["error", { "argsIgnorePattern": "req|res|next|val" }]
|
||||
}
|
||||
}
|
||||
3
4-natours/after-section-08/.prettierrc
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"singleQuote": true
|
||||
}
|
||||
31
4-natours/after-section-08/app.js
Normal file
@@ -0,0 +1,31 @@
|
||||
const express = require('express');
|
||||
const morgan = require('morgan');
|
||||
|
||||
const tourRouter = require('./routes/tourRoutes');
|
||||
const userRouter = require('./routes/userRoutes');
|
||||
|
||||
const app = express();
|
||||
|
||||
// 1) MIDDLEWARES
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
app.use(morgan('dev'));
|
||||
}
|
||||
|
||||
app.use(express.json());
|
||||
app.use(express.static(`${__dirname}/public`));
|
||||
|
||||
app.use((req, res, next) => {
|
||||
console.log('Hello from the middleware 👋');
|
||||
next();
|
||||
});
|
||||
|
||||
app.use((req, res, next) => {
|
||||
req.requestTime = new Date().toISOString();
|
||||
next();
|
||||
});
|
||||
|
||||
// 3) ROUTES
|
||||
app.use('/api/v1/tours', tourRouter);
|
||||
app.use('/api/v1/users', userRouter);
|
||||
|
||||
module.exports = app;
|
||||
5
4-natours/after-section-08/config.env
Normal file
@@ -0,0 +1,5 @@
|
||||
NODE_ENV=development
|
||||
PORT=3000
|
||||
DATABASE=mongodb+srv://jonas:<PASSWORD>@cluster0-pwikv.mongodb.net/natours?retryWrites=true
|
||||
DATABASE_LOCAL=mongodb://localhost:27017/natours
|
||||
DATABASE_PASSWORD=On0adDgBCE5ECWh6
|
||||
204
4-natours/after-section-08/controllers/tourController.js
Normal file
@@ -0,0 +1,204 @@
|
||||
const Tour = require('./../models/tourModel');
|
||||
const APIFeatures = require('./../utils/apiFeatures');
|
||||
|
||||
exports.aliasTopTours = (req, res, next) => {
|
||||
req.query.limit = '5';
|
||||
req.query.sort = '-ratingsAverage,price';
|
||||
req.query.fields = 'name,price,ratingsAverage,summary,difficulty';
|
||||
next();
|
||||
};
|
||||
|
||||
exports.getAllTours = async (req, res) => {
|
||||
try {
|
||||
// EXECUTE QUERY
|
||||
const features = new APIFeatures(Tour.find(), req.query)
|
||||
.filter()
|
||||
.sort()
|
||||
.limitFields()
|
||||
.paginate();
|
||||
const tours = await features.query;
|
||||
|
||||
// SEND RESPONSE
|
||||
res.status(200).json({
|
||||
status: 'success',
|
||||
results: tours.length,
|
||||
data: {
|
||||
tours
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
res.status(404).json({
|
||||
status: 'fail',
|
||||
message: err
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
exports.getTour = async (req, res) => {
|
||||
try {
|
||||
const tour = await Tour.findById(req.params.id);
|
||||
// Tour.findOne({ _id: req.params.id })
|
||||
|
||||
res.status(200).json({
|
||||
status: 'success',
|
||||
data: {
|
||||
tour
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
res.status(404).json({
|
||||
status: 'fail',
|
||||
message: err
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
exports.createTour = async (req, res) => {
|
||||
try {
|
||||
// const newTour = new Tour({})
|
||||
// newTour.save()
|
||||
|
||||
const newTour = await Tour.create(req.body);
|
||||
|
||||
res.status(201).json({
|
||||
status: 'success',
|
||||
data: {
|
||||
tour: newTour
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
res.status(400).json({
|
||||
status: 'fail',
|
||||
message: err
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
exports.updateTour = async (req, res) => {
|
||||
try {
|
||||
const tour = await Tour.findByIdAndUpdate(req.params.id, req.body, {
|
||||
new: true,
|
||||
runValidators: true
|
||||
});
|
||||
|
||||
res.status(200).json({
|
||||
status: 'success',
|
||||
data: {
|
||||
tour
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
res.status(404).json({
|
||||
status: 'fail',
|
||||
message: err
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
exports.deleteTour = async (req, res) => {
|
||||
try {
|
||||
await Tour.findByIdAndDelete(req.params.id);
|
||||
|
||||
res.status(204).json({
|
||||
status: 'success',
|
||||
data: null
|
||||
});
|
||||
} catch (err) {
|
||||
res.status(404).json({
|
||||
status: 'fail',
|
||||
message: err
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
exports.getTourStats = async (req, res) => {
|
||||
try {
|
||||
const stats = await Tour.aggregate([
|
||||
{
|
||||
$match: { ratingsAverage: { $gte: 4.5 } }
|
||||
},
|
||||
{
|
||||
$group: {
|
||||
_id: { $toUpper: '$difficulty' },
|
||||
numTours: { $sum: 1 },
|
||||
numRatings: { $sum: '$ratingsQuantity' },
|
||||
avgRating: { $avg: '$ratingsAverage' },
|
||||
avgPrice: { $avg: '$price' },
|
||||
minPrice: { $min: '$price' },
|
||||
maxPrice: { $max: '$price' }
|
||||
}
|
||||
},
|
||||
{
|
||||
$sort: { avgPrice: 1 }
|
||||
}
|
||||
// {
|
||||
// $match: { _id: { $ne: 'EASY' } }
|
||||
// }
|
||||
]);
|
||||
|
||||
res.status(200).json({
|
||||
status: 'success',
|
||||
data: {
|
||||
stats
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
res.status(404).json({
|
||||
status: 'fail',
|
||||
message: err
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
exports.getMonthlyPlan = async (req, res) => {
|
||||
try {
|
||||
const year = req.params.year * 1; // 2021
|
||||
|
||||
const plan = await Tour.aggregate([
|
||||
{
|
||||
$unwind: '$startDates'
|
||||
},
|
||||
{
|
||||
$match: {
|
||||
startDates: {
|
||||
$gte: new Date(`${year}-01-01`),
|
||||
$lte: new Date(`${year}-12-31`)
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
$group: {
|
||||
_id: { $month: '$startDates' },
|
||||
numTourStarts: { $sum: 1 },
|
||||
tours: { $push: '$name' }
|
||||
}
|
||||
},
|
||||
{
|
||||
$addFields: { month: '$_id' }
|
||||
},
|
||||
{
|
||||
$project: {
|
||||
_id: 0
|
||||
}
|
||||
},
|
||||
{
|
||||
$sort: { numTourStarts: -1 }
|
||||
},
|
||||
{
|
||||
$limit: 12
|
||||
}
|
||||
]);
|
||||
|
||||
res.status(200).json({
|
||||
status: 'success',
|
||||
data: {
|
||||
plan
|
||||
}
|
||||
});
|
||||
} catch (err) {
|
||||
res.status(404).json({
|
||||
status: 'fail',
|
||||
message: err
|
||||
});
|
||||
}
|
||||
};
|
||||