Fix for #1334: using relative cloud code files broken
* Adding tests for absolute and relative cloud code file loading. * Fixes #1334 by resolving relative cloud code file paths to the process' working directory.
This commit is contained in:
committed by
Florent Vilmart
parent
f99b5588ab
commit
acc23d0828
@@ -9,6 +9,7 @@ var batch = require('./batch'),
|
||||
middlewares = require('./middlewares'),
|
||||
multer = require('multer'),
|
||||
Parse = require('parse/node').Parse,
|
||||
path = require('path'),
|
||||
authDataManager = require('./authDataManager');
|
||||
|
||||
import { logger,
|
||||
@@ -142,7 +143,7 @@ class ParseServer {
|
||||
if (typeof cloud === 'function') {
|
||||
cloud(Parse)
|
||||
} else if (typeof cloud === 'string') {
|
||||
require(cloud);
|
||||
require(path.resolve(process.cwd(), cloud));
|
||||
} else {
|
||||
throw "argument 'cloud' must either be a string or a function";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user