mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-08-01 04:05:18 +00:00
feature(client) es2015-ify
This commit is contained in:
parent
8944d1522e
commit
6a5b254a75
79 changed files with 7365 additions and 9347 deletions
|
|
@ -35,6 +35,8 @@ const root = () => config('root');
|
|||
const emptyFunc = (req, res, next) => next();
|
||||
emptyFunc.middle = () => emptyFunc;
|
||||
|
||||
const isDebug = process.env.NODE_ENV === 'debug';
|
||||
|
||||
function getPrefix(prefix) {
|
||||
if (typeof prefix === 'function')
|
||||
return prefix() || '';
|
||||
|
|
@ -297,8 +299,11 @@ function setUrl(pref) {
|
|||
|
||||
req.url = req.url.replace(prefix, '') || '/';
|
||||
|
||||
if (req.url === '/cloudcmd.js')
|
||||
req.url = '/client/cloudcmd.js';
|
||||
if (/^\/cloudcmd\.js(\.map)?$/.test(req.url))
|
||||
req.url = `/dist${req.url}`;
|
||||
|
||||
if (isDebug)
|
||||
req.url = req.url.replace(/^\/dist\//, '/dist-debug/');
|
||||
|
||||
next();
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue