generator-vue-starter
Advanced tools
Comparing version 0.1.8 to 0.1.9
@@ -8,2 +8,5 @@ | ||
exports.appCfg = { | ||
"urlpairs": { | ||
"^/$": "index.html" | ||
}, | ||
"proxy": { | ||
@@ -10,0 +13,0 @@ "/some/api1/": "http://testhost1", //以“/some/api1”开头的接口,如 “/some/api1/some/method” 在mock模式下会指向src/mock/some_method.json dev模式下会重定向到http://testhost1/some/api1/some/method |
@@ -14,4 +14,13 @@ const {resolve} = require('path'); | ||
const mockbase = resolve(srcPath, 'mock'); | ||
function renderPage(req, res) { | ||
const paths = Object.keys(appCfg.urlpairs); | ||
for (let i = 0, len = paths.length; i < len; i++) { | ||
let path = paths[i]; | ||
if (req.path.match(new RegExp(path))) { | ||
res.redirect(`/${appCfg.urlpairs[path]}`); | ||
return ; | ||
} | ||
} | ||
} | ||
function getMockProxyConf(){ | ||
@@ -18,0 +27,0 @@ const conf = {}; |
{ | ||
"name": "generator-vue-starter", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"description": "This is a generator for vue+webpack. You can choose to start with a base structure of a quick-start structure", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30473
854