...
|
...
|
@@ -19,16 +19,19 @@ const co = require('bluebird').coroutine; |
|
|
|
|
|
const shop = {
|
|
|
|
|
|
rewrite(req, res, next) {
|
|
|
let pathParams = _.last(_.split(req.url.replace('.html', ''), '/'));
|
|
|
let shopId = _.last(_.split(pathParams, '-'));
|
|
|
|
|
|
if (_.isNumber(+shopId)) {
|
|
|
req.query.shop_id = shopId;
|
|
|
}
|
|
|
onlyDomain(req, res, next) {
|
|
|
req.query.domain = req.params.domain;
|
|
|
shop.entry(req, res, next);
|
|
|
},
|
|
|
|
|
|
req.query.domain = pathParams.replace(`-${shopId}`, '');
|
|
|
onlyShopId(req, res, next) {
|
|
|
req.query.shop_id = req.params[0];
|
|
|
shop.entry(req, res, next);
|
|
|
},
|
|
|
|
|
|
rewrite(req, res, next) {
|
|
|
req.query.domain = req.params.domain;
|
|
|
req.query.shop_id = req.params.shop_id;
|
|
|
shop.entry(req, res, next);
|
|
|
},
|
|
|
|
...
|
...
|
|