mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
fix(route) prefix without "/" at beginning in rendered view
This commit is contained in:
parent
2a215481ba
commit
26ee40697b
3 changed files with 16 additions and 22 deletions
|
|
@ -14,6 +14,7 @@
|
|||
validate = require(DIR_SERVER + 'validate'),
|
||||
prefixer = require(DIR_SERVER + 'prefixer'),
|
||||
|
||||
apart = require('apart'),
|
||||
join = require('join-io'),
|
||||
ponse = require('ponse'),
|
||||
mollify = require('mollify'),
|
||||
|
|
@ -141,11 +142,11 @@
|
|||
return config(name);
|
||||
},
|
||||
|
||||
isMinify = isOption.bind(null, 'minify'),
|
||||
isOnline = isOption.bind(null, 'online'),
|
||||
isCache = isOption.bind(null, 'cache'),
|
||||
isDiff = isOption.bind(null, 'diff'),
|
||||
isZip = isOption.bind(null, 'zip'),
|
||||
isMinify = apart(isOption, 'minify'),
|
||||
isOnline = apart(isOption, 'online'),
|
||||
isCache = apart(isOption, 'cache'),
|
||||
isDiff = apart(isOption, 'diff'),
|
||||
isZip = apart(isOption, 'zip'),
|
||||
|
||||
ponseStatic = ponse.static(DIR_ROOT, {
|
||||
cache: isCache
|
||||
|
|
@ -206,10 +207,7 @@
|
|||
}),
|
||||
|
||||
rest,
|
||||
|
||||
route({
|
||||
prefix: prefix
|
||||
}),
|
||||
route,
|
||||
|
||||
join({
|
||||
dir : DIR_ROOT,
|
||||
|
|
|
|||
|
|
@ -19,9 +19,13 @@
|
|||
|
||||
minify = require('minify'),
|
||||
format = require('format-io'),
|
||||
squad = require('squad'),
|
||||
apart = require('apart'),
|
||||
|
||||
config = require(DIR_SERVER + 'config'),
|
||||
root = require(DIR_SERVER + 'root'),
|
||||
prefixer = require(DIR_SERVER + 'prefixer'),
|
||||
prefix = squad(prefixer, apart(config, 'prefix')),
|
||||
|
||||
CloudFunc = require(DIR_LIB + 'cloudfunc'),
|
||||
|
||||
|
|
@ -37,8 +41,6 @@
|
|||
|
||||
Template = {},
|
||||
|
||||
Prefix,
|
||||
|
||||
FS = CloudFunc.FS,
|
||||
|
||||
CSS_URL = require(DIR_JSON + 'css.json')
|
||||
|
|
@ -47,15 +49,7 @@
|
|||
}).join(':');
|
||||
|
||||
|
||||
module.exports = function(params) {
|
||||
var p = params || {};
|
||||
|
||||
Prefix = p.prefix || '';
|
||||
|
||||
return middle;
|
||||
};
|
||||
|
||||
function middle(req, res, next) {
|
||||
module.exports = function (req, res, next) {
|
||||
readFiles(function() {
|
||||
route(req, res, next);
|
||||
});
|
||||
|
|
@ -95,7 +89,7 @@
|
|||
data = rendy(data, {
|
||||
title : CloudFunc.getTitle(),
|
||||
fm : left + right,
|
||||
prefix : Prefix,
|
||||
prefix : prefix(),
|
||||
css : CSS_URL
|
||||
});
|
||||
|
||||
|
|
@ -214,7 +208,7 @@
|
|||
if (!error) {
|
||||
panel = CloudFunc.buildFromJSON({
|
||||
data : json,
|
||||
prefix : config('prefix'),
|
||||
prefix : prefix(),
|
||||
template : Template
|
||||
}),
|
||||
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@
|
|||
},
|
||||
"subdomain": "cloudcmd",
|
||||
"dependencies": {
|
||||
"apart": "~1.0.1",
|
||||
"chalk": "~1.1.0",
|
||||
"checkup": "~1.3.0",
|
||||
"console-io": "~2.7.1",
|
||||
|
|
@ -98,6 +99,7 @@
|
|||
"restafary": "~1.6.0",
|
||||
"socket.io": "~1.4.3",
|
||||
"spero": "~1.3.0",
|
||||
"squad": "~1.1.3",
|
||||
"try-catch": "~1.0.0",
|
||||
"tryrequire": "~1.1.5",
|
||||
"writejson": "~1.1.0"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue