mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-21 02:29:23 +00:00
fix(route) buildIndex: no index.html
This commit is contained in:
parent
d2229e965a
commit
4808a18305
2 changed files with 26 additions and 5 deletions
|
|
@ -26,7 +26,6 @@ const isDev = process.env.NODE_ENV === 'development';
|
|||
|
||||
const getIndexPath = () => {
|
||||
const dist = isDev ? 'dist-dev' : 'dist';
|
||||
|
||||
return DIR + `${dist}/index.html`;
|
||||
};
|
||||
|
||||
|
|
@ -214,17 +213,17 @@ function route(request, response, callback) {
|
|||
function buildIndex(json, callback) {
|
||||
fs.readFile(getIndexPath(), 'utf8', (error, template) => {
|
||||
if (error)
|
||||
return;
|
||||
return callback(error);
|
||||
|
||||
const panel = CloudFunc.buildFromJSON({
|
||||
data: json,,
|
||||
data: json,
|
||||
prefix: prefix(),
|
||||
template: Template
|
||||
template: Template,
|
||||
});
|
||||
|
||||
const data = indexProcessing({
|
||||
panel,
|
||||
data: template
|
||||
data: template,
|
||||
});
|
||||
|
||||
callback(error, data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue