@@ -90,10 +90,10 @@ exports.api_getcode_handler = function( app, req, res, pathmatches ) {
90
90
return ;
91
91
}
92
92
var outdata = {
93
- htmldata : getFile ( path + '/views/ apps/' + apptoedit + '/index.html' ) ,
94
- jsdata : getFile ( path + '/static/ apps/' + apptoedit + '/js/index.js' ) ,
95
- cssdata : getFile ( path + '/static/ apps/' + apptoedit + '/css/index.css' ) ,
96
- appdata : getFile ( path + '/apps/' + apptoedit + '/app.js' )
93
+ htmldata : getFile ( path + '/apps/' + apptoedit + '/views /index.html' ) ,
94
+ jsdata : getFile ( path + '/apps/' + apptoedit + '/static /js/index.js' ) ,
95
+ cssdata : getFile ( path + '/apps/' + apptoedit + '/static /css/index.css' ) ,
96
+ appdata : getFile ( path + '/apps/' + apptoedit + '/app /app.js' )
97
97
} ;
98
98
99
99
res . json ( outdata ) ;
@@ -119,7 +119,7 @@ exports.api_media_remove_handler = function( app, req, res ) {
119
119
return ;
120
120
}
121
121
122
- var fpath = process . cwd ( ) + '/static/ apps/' + appname + '/media/' + fname ;
122
+ var fpath = process . cwd ( ) + '/apps/' + appname + '/static /media/' + fname ;
123
123
util . log ( "MEDIA DELETE: " + fpath ) ;
124
124
err = fs . unlinkSync ( fpath ) ;
125
125
if ( ! err ) {
@@ -149,7 +149,7 @@ exports.api_media_upload_handler = function( app, req, res ) {
149
149
res . json ( { status : 'error' , error : "couldn't read file" } ) ;
150
150
return ;
151
151
}
152
- var path = process . cwd ( ) + '/static/ apps/' + appname + '/media/' + fname ;
152
+ var path = process . cwd ( ) + '/apps/' + appname + '/static /media/' + fname ;
153
153
fs . writeFile ( path , data , function ( err ) {
154
154
if ( ! err ) {
155
155
res . json ( {
@@ -188,13 +188,13 @@ exports.api_savecode_handler = function( app, req, res, pathmatches ) {
188
188
var data = req . param ( 'data' ) ;
189
189
var filepath = null ;
190
190
if ( datatype === 'css' ) {
191
- filepath = path + '/static/ apps/' + apptoedit + '/css/index.css'
191
+ filepath = path + '/apps/' + apptoedit + '/static /css/index.css'
192
192
} else if ( datatype === 'html' ) {
193
- filepath = path + '/views/ apps/' + apptoedit + '/index.html'
193
+ filepath = path + '/apps/' + apptoedit + '/views /index.html'
194
194
} else if ( datatype === 'js' ) {
195
- filepath = path + '/static/ apps/' + apptoedit + '/js/index.js'
195
+ filepath = path + '/apps/' + apptoedit + '/static /js/index.js'
196
196
} else if ( datatype === 'app' ) {
197
- filepath = path + '/apps/' + apptoedit + '/app.js'
197
+ filepath = path + '/apps/' + apptoedit + '/app/app .js'
198
198
}
199
199
200
200
coderlib . app ( apptoedit , function ( err , app ) {
@@ -272,7 +272,7 @@ exports.api_savesettings_handler = function( app, req, res, pathmatches ) {
272
272
273
273
exports . listMedia = function ( appname ) {
274
274
var path = process . cwd ( ) ; //root application path. different from __dirname
275
- var mediadir = path + "/static/ apps/" + appname + "/media/" ;
275
+ var mediadir = path + "/apps/" + appname + "/static /media/" ;
276
276
var media = { } ;
277
277
var files = fs . readdirSync ( mediadir ) ;
278
278
for ( var x in files ) {
0 commit comments