Invoke The API Service Using Generated Client SDK missions is broken

Hi team,

I am trying to work through the missions, however the “Invoke The API Service Using Generated Client SDK” mission seems to be broken.

backendless.min.js is throwing the following error when trying to call the endpoints of the demo service:

Uncaught (in promise) Error: Content type ‘’ is not allowed for upload files. Use ‘multipart/form-data’ or ‘application/json’.

Also, I had to install an add-in to disable CORS protection in Chrome, which is unrelated but thought i would mention it.

Please find attached screenshots of the code and console error.


Im eager to finish my missions!

Cheers,
Dan

Hello @Dan_iel

If you do the same without server URL, the error still appears?

With the Server URL variable commented out we get the attached.

I guess it defaults to api.backendless.com and gives a 404 because that route is not available.

Hello @Dan_iel!

Could you please check if you forgot to add this line of code as specified in the mission description:
Backendless.initApp( "https://your-subdomain-name.backendless.app" );

Regards,
Alexander

Where do you put this line of code? I am stuck on the same step as the OP with the same result.

Hello @Bryan_Grasso

According to the video in the mission description, you can find the initApp method in the CodelessShoppingCartService.js file on line 31.

Regards,
Inna

Inna,

That file shown in the video looks much different than what the current version is. The video nor the tutorial do not call out that anything from the mission needs to be added to this file. Do I need to add all the logic on lines 6-10 and 30-31 (from your screenshot)?

I have attached the version that your platform created for me.

This is why I am hung up. The tutorial and video doesn’t line up with what the current reality is. Can you please review and let me know how to proceed, and update the mission so it’s more clear for others?

– Bryan

CodelessShoppingCartService.js.zip (1.4 KB)

In an effort to try to apply the logic that you advised. I added all the items missing from my file into the file from your (and the youtube) screenshot. So far, it does not seem like it will work.

I am including a screenshot and a copy of the updated file.


CodelessShoppingCartService (1).js.zip (1.6 KB)

Hi @Bryan_Grasso

I assume Inna’s answer was based on your origin question

So, no need to add any additional code, just try to replace only one line

Regards,
Vlad

The main issue is that If cant get the serverless 101 tutorial to work. I thought it was because i couldnt add this line of code. However, based on your response, I still don’t understand what to edit and where. The video and this file don’t match up snywhere close.

  • try to download a fresh version of your client SDK, to rollback all changes you applied
  • find the line with Backendless.initApp(....)
  • then replace it with your app API subdomain (you can find the domain on the Manage screen)

I downloaded a fresh copy of the SDK. It looks the exact same as before. I dont see any lines that include “initApp”. Attached is a screenshot of the file and my search of the file.

What gives? Is there something else I can try?

Hey @Bryan_Grasso,

just put the line Backendless.initApp('https://plummybranch-us.backendless.app') at the very beginning of the CodelessShoppingCartService.js file. Should be like this:

Hope that helps!

Regards,
Stanislaw