can I deploying cloud function to back4app?

2,133 views
Skip to first unread message

claudio barbera

unread,
Mar 12, 2016, 8:33:14 AM3/12/16
to back{4}app
Hi, it's possible to deploying a cloud code function or background job? 
Message has been deleted

Davi Macêdo

unread,
Mar 14, 2016, 9:24:02 AM3/14/16
to back{4}app
Hi, Claudio. Command line tool is not yet available for back4app. So you will not be able to run "parse deploy" in the moment. BUT we have launched in our dashboard a place in which you can select and upload your cloud code files through the web browser. To find this feature you have to access dashboard.back4app.com, click on your app and select the option "Cloud Code Settings". There you will find a file explorer in which you can manage your files and folders, an upload button and also a place in which you can see your files.


xosebarreiro

unread,
Mar 14, 2016, 6:48:22 PM3/14/16
to back{4}app
Only accept js?? When can I import SQL, CSV or JSON?? In the app dashboard I can create tables with relationships, how can I in SQL.??

Davi Macêdo

unread,
Mar 14, 2016, 9:01:48 PM3/14/16
to back{4}app
back{4}app generates backend code and REST APIs using Parse Server open source framework, that was developed using express.js (a node.js web framework). Therefore the unique accepted language now is javascript. BUT we aim to generate backend in the future using other frameworks like Ruby on Rails or Django.

Importing data into the classes is not available, but I think it is also a very good idea to the future. However you can use a mongo client to connect to your database and import you data directly there.

About relationships, it is possible. You can create in your classes columns of type "Relation"

arie...@gmail.com

unread,
Apr 12, 2016, 2:47:02 PM4/12/16
to back{4}app
Does cloud code function has running time limitation like parse?

Davi Macêdo

unread,
Apr 13, 2016, 1:45:49 AM4/13/16
to back{4}app
Now there is no limitation. But it's possible you will add in the future. So keep your functions lean :)

jdubr...@csas.cz

unread,
May 15, 2016, 5:09:32 AM5/15/16
to back{4}app
Hi David, is there any roadmap when CLI will work on back4app ? 

Davi Macêdo

unread,
May 17, 2016, 5:05:03 PM5/17/16
to back{4}app
Hi. I haven't a data yet, but we are publishing job scheduling tomorrow morning and then we will start developing this feature. Probably it will be available by the next week. Best!

Eric Hong

unread,
May 25, 2016, 3:00:49 PM5/25/16
to back{4}app
Any update on cloud job implementation?   I just tried loading my cloud job via back4app CloudCode UI and still got this error below.  Also doing "curl -x POST ….. https://parseapi.back4app.com/jobs/MyCloudJob" via the REST interface got the "{"message":"Not Found","error":{}}" error, most likely due to that the Parse.Cloud.job() in my cloud code is not being loaded.

Eric

Cloud Code not loaded:
 [TypeError: Parse.Cloud.job is not a function]

Davi Macêdo

unread,
May 26, 2016, 9:34:35 PM5/26/16
to back{4}app
Hi, Eric. Jobs are not yet available. We are now doing the last tests on it. In the worst case it will be available in the next Tuesday. But probably it will be available earlier. Best.

hanni...@gmail.com

unread,
May 27, 2016, 10:58:43 AM5/27/16
to back{4}app
are there any changes I need to make to my cloud code? I read in Parse migration guide that I need to replace Parse.Cloud.useMasterKey() or also change the relative paths like 'cloud/...' to './cloud/..'

appreciate your help as this is the last thing to do before I launch my app..thanks

Davi Macêdo

unread,
May 27, 2016, 12:13:53 PM5/27/16
to back{4}app
Hi

Parse.Cloud.useMasterKey() doesnt throw any exception but it does nothing anymore. If you need to query some class that requires master key, you have to use { useMasterKey: true } option.

About files reference just reference them require('./nameofthefile.js')

Best!

paul...@gmail.com

unread,
Jun 22, 2016, 8:28:51 PM6/22/16
to back{4}app
Hi Davi. Could you give me a help?

I uploaded my cloud code (main.js) that was on Parse to back4app.
When i tried to schedule a job, it doesn`t work.
So, i went to App Logs and there was the following message:

Cloud Code not loaded:
 { [Error: Cannot find module './data/cloud/main'] code: 'MODULE_NOT_FOUND' }

My code is the same that is online in Parse.
Can you tell what is the problem?

Davi Macêdo

unread,
Jun 30, 2016, 5:00:07 AM6/30/16
to back{4}app
Hi, Paulo.

I've just checked your logs and your cloud code was correctly loaded. It is an old message. In the next release of back4app this UX issue will not occur again.

So your job should be working. What is the error you have when scheduling it?

Best

paul...@gmail.com

unread,
Jun 30, 2016, 8:51:45 PM6/30/16
to back{4}app
Hi Davi.
Thanks for the answer.

I tried again and now the job was successfull scheduled.
The error message before was that the function does not exist, or something like that.

Now, i think that the interface is showing the wrong schedule time. 
The job browser show the schedule time is 00:40 UTC. I scheduled it to 05:00 UTC.

Davi Macêdo

unread,
Jul 5, 2016, 2:02:21 PM7/5/16
to back{4}app, Ricardo Seiji
@ricardo Can you check it please?

Seiji Akiyama

unread,
Jul 5, 2016, 2:44:17 PM7/5/16
to back{4}app
Howdy, Paulo!

I've checked the Job configuration and everything seems ok!
Look, look:

start: 2016-07-01T00:40:41.481Z,
daily_run: 05:00

It seems like we have another UX issue and we're truly sorry about it.
We're showing the start date on the "Schedule" column at "Job Browser".

But your daily run is scheduled for 05:00 UTC.

If something happens on the first run, please, tell us!
Sayounara!

c.wa...@votinglab.de

unread,
Jul 7, 2016, 10:21:19 AM7/7/16
to back{4}app
Hey Davi, 

is there any news on the CLI interface for uploading cloud code? 

Davi Macêdo

unread,
Jul 8, 2016, 1:18:53 AM7/8/16
to back{4}app
Not yet... We are already develping this feature and current worst case scenario ETA is end of July. Best!

ma...@cafepress.com

unread,
Jul 15, 2016, 3:07:49 AM7/15/16
to back{4}app
I'm getting the same error.  No idea why.


Cloud Code not loaded:
 { [Error: Cannot find module './data/cloud/main'] code: 'MODULE_NOT_FOUND' }

When I try running my cloud function, I get this:

https://parseapi.back4app.com/1/functions/nextcode : Failed to load resource: the server responded with a status of 404 (Not Found)

Any idea what might be going on?

ma...@cafepress.com

unread,
Jul 18, 2016, 3:45:04 PM7/18/16
to back{4}app
Figured it out.  I was using an order version of parse.js.  Upgraded to the latest, and everything works.

Davi Macêdo

unread,
Jul 19, 2016, 5:46:50 PM7/19/16
to back{4}app
Good to know it.

Another comment is about the endpoint. Make sure you are using https://parseapi.back4app.com/functions/nextcode, without /1/

If you have any problem, let me know.

Best!

c.wa...@votinglab.de

unread,
Aug 9, 2016, 3:22:33 AM8/9/16
to back{4}app
Sorry, I have to be pushing about this feature, but it would be great to know a real date for this be deployed. I really want to move some apps of mine to back4app, but without cli, this is really painful. 

Davi Macêdo

unread,
Sep 12, 2016, 11:25:19 PM9/12/16
to back{4}app
Hi, @cwalzel,

If you want to help us as a beta tester of CLI tool, please reach us through web-site chat. I will setup it for you.

Best.

c.wa...@votinglab.de

unread,
Nov 11, 2016, 5:34:31 PM11/11/16
to back{4}app
Hi Davi, 

is there any news on the CLI. I reached you via chat and you wanted to set the CLI up, however i am unable to find it my Dashboard. 
Can the CLI be installed via npm?
And by the way, how to i deploy data to your web-hosting service? 
Best, 
cwalzel

Davi Macêdo

unread,
Nov 22, 2016, 10:52:16 AM11/22/16
to back{4}app
Hi. We will probably launch for all users by the end of the current week. Best!

dav...@gmail.com

unread,
Nov 27, 2016, 11:01:36 AM11/27/16
to back{4}app
Hey, any update on this? Did the launch happen this week in the end?

Davi Macêdo

unread,
Nov 27, 2016, 4:25:59 PM11/27/16
to back{4}app
Hi, Guys. Not yet. I apologize for it. It has delayed little bit but the CLI deployment is now scheduled (and fixed) to occur in December 4th. Best.

lex...@gmail.com

unread,
Dec 22, 2016, 10:24:06 PM12/22/16
to back{4}app
Where is the CLI?

casag...@back4app.com

unread,
Dec 23, 2016, 6:58:19 AM12/23/16
to back{4}app
Hello!

The CLI is on a BETA version and you can send us an email requiring your paticipation.

Best!

Alexis L.

unread,
Jan 14, 2017, 12:47:32 AM1/14/17
to back{4}app
Hi 
Can you add me to the CLI beta ?
thanks!

Davi Macêdo

unread,
Jan 14, 2017, 2:54:59 PM1/14/17
to back{4}app
Sure.

Thank you for helping us.


We prepared our servers to integrate with the same CLI tool parse.com already provided.


Please, follow the steps below to start using it:

1) First of all, you need an Account Key. Sign in Back4app -> Click in your username that you can find in the right upper side of the screen -> Click in Account key -> Create a new account key and take no of it;

2) Install the CLI from the following link (it is an archive link of the old parse.com web site, but we are creating our own docs in our web site): https://web.archive.org/web/20160112010649/https://parse.com/docs/cloudcode/guide#command-line-installation

3) Use the following command to make the CLI connect to Back4app servers: export PARSE_SERVER=“https://parsecli.back4app.com

4) Use the following command to setup your Account key to the CLI: parse configure accountkey

5) Use the following command to start coding for a new or existing project (when asked where you want to deploy, choose 2) Parse): parse new

6) Use the following command to deploy your code: parse deploy


If you need any help or find any problem, let me know.


Best.

mic...@gmail.com

unread,
Jan 14, 2017, 4:36:47 PM1/14/17
to back{4}app
Supreeeeeme :)

I had one little problem that after uploading new .js file, on server it had content of null.
I found out that it was caused with this function:
function isoToUtf8(input){
    var map = {
        "À":"À",
        "Â":"Â",
        "Ä":"Ä",
        "Ã…":"Å",
        "Æ":"Æ",
        "Ç":"Ç",
        "È":"È",
        "É":"É",
        "Ê":"Ê",
        "Ë":"Ë",
        "ÃŒ":"Ì",
        "ÃŽ":"Î",
        "Ñ":"Ñ",
        "Ã’":"Ò",
        "Ó":"Ó",
        "Ô":"Ô",
        "Õ":"Õ",
        "Ö":"Ö",
        "×":"×",
        "Ø":"Ø",
        "Ù":"Ù",
        "Ú":"Ú",
        "Û":"Û",
        "Ü":"Ü",
        "Þ":"Þ",
        "ß":"ß",
        "Ã ":"à",
        "á":"á",
        "â":"â",
        "ã":"ã",
        "ä":"ä",
        "Ã¥":"å",
        "æ":"æ",
        "ç":"ç",
        "è":"è",
        "é":"é",
        "ê":"ê",
        "ë":"ë",
        "ì":"ì",
        "í":"í",
        "î":"î",
        "ï":"ï",
        "ð":"ð",
        "ñ":"ñ",
        "ò":"ò",
        "ó":"ó",
        "ô":"ô",
        "õ":"õ",
        "ö":"ö",
        "÷":"÷",
        "ø":"ø",
        "ù":"ù",
        "ú":"ú",
        "û":"û",
        "ü":"ü",
        "ý":"ý",
        "þ":"þ",
        "ÿ":"ÿ",
        "ϳ":"ó",
        "¢":"¢",
        "Ï":"à"
    }
    var regex = [];;
        
    for (var prop in map) {
        regex.push(prop);
    }

    regex = new RegExp( regex.join('|'), "g" );

    return input.replace(regex, function(match) {
      return map[match];
    });
}

Is there some validation of .js file? If yes maybe it have some problems with this special chars.
(Im not using this function anymore so CLI is working great for me)

Thanks for this awesome feature of CLI.

cha...@back4app.com

unread,
Jul 10, 2017, 4:07:18 PM7/10/17
to Back4App, barbera...@gmail.com
Hi!

Were you able to solve it?

Regards,

Charles Ramos

Em sábado, 12 de março de 2016 10:33:14 UTC-3, claudio barbera escreveu:
Hi, it's possible to deploying a cloud code function or background job? 
Reply all
Reply to author
Forward
0 new messages