Skip to content

Commit

Permalink
Fixes parse-community#1334 by resolving relative cloud code file path…
Browse files Browse the repository at this point in the history
…s to the process' working directory.
  • Loading branch information
airdrummingfool committed Apr 4, 2016
1 parent 7462007 commit 8445d76
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var ParseServer = require('../src/index').ParseServer;
var path = require('path');

var databaseURI = process.env.DATABASE_URI;
var cloudMain = process.env.CLOUD_CODE_MAIN || '../spec/cloud/main.js';
var cloudMain = process.env.CLOUD_CODE_MAIN || './spec/cloud/main.js';
var port = 8378;

// Default server configuration for tests.
Expand Down
3 changes: 2 additions & 1 deletion src/ParseServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -140,7 +141,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";
}
Expand Down

0 comments on commit 8445d76

Please sign in to comment.