findPage = function(req, json, cb) {
db.pages.find({
url: req
}, function(err, docs) {
if (err) cd(err);
console.log(docs);
json = docs; // Искомые данные для страницы
cb(null, json)
});
};
app.use(function *() {
'use strict';
var json, req;
req = this.request.url;
console.log(req);
findPage(req, json, function(err, data) {
if (err) throw err;
page = this.render('index', {page: data}, true) // рендер страницы
});
});
gulp.task('styles', function () {
return gulp.src(paths.source.styles + 'layout.sss')
.pipe(plumber({errorHandler: errorHandler}))
.pipe(postcss(processors, { parser: sugarss }))
.pipe(rename('style.css'))
.pipe(gulp.dest(paths.build.styles))
.pipe(cssnano({discardComments: {removeAll: true}, convertValues: {length: false}}))
.pipe(rename('style.min.css'))
.pipe(gulp.dest(paths.build.styles))
.pipe(reload({stream: true}));
});
var utm = location.search;
var url = new URL('http://site2.ru');
url.search = utm;
location.replace(url);
io.on('connection', socket => {
socket.on('disconnect', () => {
// ваш код
})
})
<img src="/img/file.12345.jpg">
<img src="/img/file.12345.jpg">
<img src="/img/file.12345.jpg">