Code not being deployed from vs code to backendless

App ID: B73DF939-DF75-2BB1-FF9D-4584DD35BA00

First of all, its kind of cofusing because most information I find seems to be outdated and backendless uses different names and maybe different processes now.

I went to Cloud Code - JS, and downlaoded the code to my pc.

I copied it to a folder and opened in vs code.

This is the package.json file which I added the line for neo4j:

{
  "name": "NWIS-servercode",
  "version": "1.0.0",
  "scripts": {
    "debug": "coderunner debug",
    "deploy": "coderunner deploy"
  },
  "devDependencies": {
    "backendless-coderunner": "^6.1.5",
    "neo4j-driver":"^5.7.0"
  },
  "license": "MIT"
}

and this is the coderunner.json file:

{
  "backendless": {
    "apiServer": "https://api.backendless.com",

    "msgBroker": {
      "host": "cl.backendless.com",
      "port": 6379
    }
  },

  "app": {
    "id": "B73DF  key proveded by server  5BA00",
    "apiKey": "500DCF  key proveded by server  C30F865",
    "model": "default",
    "exclude": [
        "package.json",
        "coderunner.json",
        "README.md",
        "servercode.iml",
        "servercode.ipr",
        "servercode.iws"
    ]
  }
}

and this is the only code I have added to the project so far:
testCode/test.js

all it does is return some json form neo4j.

I can build and run this in vs code just fine.

I deploy by using this command:

npm run deploy

I’m prompted to enter Y which I do, then I get this response:

Would you like to continue? (Y/N)y
17:24:09.626 [master] Building Model…
17:24:09.629 [master] ServerCode Model built in 3ms
17:24:09.630 [master] Error: Error: Nothing to publish

any idea why it does not deploy?

I have spent more than half a day getting to this point so any help would be most apriciated.

thanks!

I am curious about what your expectations were with the code you’re publishing. Could you describe what you think would happen once you published it?

Hi Mark!

First, its a test to see that I can deploy code developed in vs code.

Second, the idea is that something like this could be used in a custom block which in turn could be used to populate a list control.

I started off trying to put this code in a custom block but needed to install the neo4j driver first which I could not find a way to do. after hours of searching, it seemed this was the only was install the third party driver. If there’s another way, please let me know, that would be nice.

However, I would still like to know how to deploy code from vs code. from what I can tell I did everything correctly.

Thank you for any help you can offer.

Hi George,

Per the documentation, cloud code can run only in the following forms:

  • API services
  • Event handlers
  • Timers

The doc is here: Developing Backendless Server Code with node.js

The code you are deploying does not conform to any of the expected formats. As a result, code runner says that there is no code to be published.

Regards,
Mark

OK. How can I fetch data from a neo4j database?

That question is not covered by our support charter, it would be in the realm of consulting services.

Regards,
Mark