App Schema done

This commit is contained in:
Luis Fernando Molina committed 2019-12-07 12:09:37 +01:00
1 parent f09dc1eec5
commit 0a9f0c8bf3
2 files changed
+23

No files matched your search

+1
View File
@@ -31,6 +31,7 @@ function newAppLoader() {
'Globals.js',
'Ecosystem.js',
'UserEcosystem.js',
'AppSchema.js',
'MQService',
'ChartsSpace/ChartUtilities.js',
+22
View File
@@ -339,6 +339,28 @@ function onBrowserRequest (request, response) {
}
break
case 'AppSchema.js':
{
let fs = require('fs')
try {
let filePath = process.env.INTER_PROCESS_FILES_PATH + '/AppSchema.json'
fs.readFile(filePath, onFileRead)
} catch (e) {
console.log('[ERROR] Error reading the App Schema.', e)
}
function onFileRead(err, appSchema) {
if (err) {
respondWithContent(undefined, response)
} else {
let responseContent = 'function getAppSchema(){ return ' + appSchema + '}'
respondWithContent(responseContent, response)
}
}
}
break
case 'Storage':
{
respondWithFile(process.env.STORAGE_PATH + '/' + request.url.substring(9), response)