cancel
Showing results for 
Search instead for 
Did you mean: 

How is it possible to build node.js app to Cloud Foundry from WebIDE Full Stack?

former_member192683
Participant
0 Kudos

Hi Dear Community,

When I build HDB Module in WebIDE Full-Stack, it is successfully built on cloud foundry, since I've configured CF settings in the workspace.

But it's not the same when trying to build or run node.js app. It's targetting SCP Neo, and creates an instance in Neo. When I try to run it directly it stays suspended as well and doesn't respond.

Is it possible to run a node.js module developed in WebIDE Full-stack via SAP CF same like HDB module?

Thank you,

Ceyhun

Accepted Solutions (1)

Accepted Solutions (1)

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Ceyhun,

Just to clarify one more thing about the temporary application instance WebIDE creates for your. It gets created so a single developer can test its work on WebIDE independently from other developers on the same org/space. Once you stop the app via WebIDE it deletes the instance from your org/space.

Whenever you build the whole MTA project it generates an mtar file which you can deploy to your org/space. The difference here is that this mtar files will deploy all modules in a single run. In that sense, if you chose to deploy the mtar files in addition to running the NodeJS module, you will probably end up with two instances of the same software taking up valuable resources such as routes and memory.

In addition to this the mtar file will probably represent a candidate to become productive software. And if your have dev/ops in place with continuous integration software it can pickup the mtar file to deploy automatically via CF CLI on another org/space (probably a test space) and later on a productive org/space. You could also investigate the blue/green deployment for such use cases.

Regarding the IDE I think there is no correct way to go or even best practices. Some will say that serious native cloud development has to be done with Eclipse or IntelliJ IDEA, whereas other may say VS-Code is the way to go and there are people such as yourself that may prefer a web tool. I strongly believe that all tools are valuable assets in some specific areas whereas others are stronger with something else.

What I can say about WebIDE is that you ought to probably work heavily with Git and CI/CD tools. For that you can read the following document which deals with thoroughly.

Best regards,
Ivan

Answers (3)

Answers (3)

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert

Hi Ceyhun,

I think you are confusing things here. Neo doesn't run NodeJS applications - it doesn't have that type of runtime container as an option.

However, there are situations when the run command will prompt you with user credentials from Neo environment. More specifically when you try to run an html5 application that uses destinations. You have to enter the neo credentials so that WebIDE can create the necessary destinations in Neo - simply because the web testing feature uses neo's destinations (not CF's). This is still true for the time being, as CF destinations is a fairly new feature that came much later than WebIDE Full-Stack. As time goes by, I believe that WebIDE will start using CF's destinations instead of Neo's - let's wait and see how this progresses.

To check that a NodeJS application was deployed on CF, please issue the following CLI command or open the cockpit under your space to check under Applications menu:

cf apps

You have to log on to your CF instance and make the target the same as your org/space.

Keep in mind that a NodeJS module, while being tested will be deployed with a dynamic name, composed of a unique identifier plus the application name. So, you will see the plain real name for each application's module (microservice) in the application list only after you deploy the application to CF - not while testing it.

Many developers can work at the same module at the same time using source control in a Git repository and use the same org/space to do so. Thus, CF needs to allow them to test each one's version independently.

Best regards,
Ivan

former_member192683
Participant

Hi Ivan,

Thank you very much for the contribution. As you say, I see the unique identifier with the application name in Cloud Foundry instances. I get the point on how Cloud Foundry offers an independent development environment.

So, as I see testing also deploys an instance of the application with a unique name. But technically it is also an application just as we deploy the original one. Can we say this?

Thanks,

Ceyhun

mariusobert
Developer Advocate
Developer Advocate

Hi Ceyhun,

Can you please explain your problem a little bit more into detail?

You will always run your node module in CF (Neo cannot run node modules). When you click "run", the SAP Web IDE will "deploy your workspace" and is able to update the codebase once you make changes and click "run" another time.

Clicking "build" will start a process which outputs a MTA file, which you need to deploy to CF manually.

Regards,

Marius

former_member192683
Participant
0 Kudos

Hi Marius,

Thank you.

So you mean "build" and "run" behaves differently for NodeJS? Actually, what I'd expect "run" does the same building process, plus it just runs it. For the HDB module, we just build it and it does the work making the changes in DB.

Regards,

Ceyhun

former_member192683
Participant
0 Kudos

Hi Ivan and Marius,

Thank you for your responses. Let me try to clarify the issue.

Actually, I'm ok with the fact that Neo doesn't run NodeJS apps. I'm trying to find the way to run and build the applications/microservices that are developed by WebIDE Full-Stack which is a Neo service. But I want to run them in Cloud Foundry destination, not Neo since NodeJS work only on Cloud Foundry.

I have both Neo and CF accounts. But first of all, I use Neo for the development because WebIDE Full-stack is only included in Neo, CF doesn't supply any IDE as a service. That's currently true, right? I don't prefer using a desktop IDE either, the reason is WebIDE automatically creates the folder structure for each module and makes the development easy. I think it'd be really difficult to create all the folder and file structure manually. By the way, I am open to any suggestions if you have any best practice to use which development tools and how to build and deploy.

I am working on the famous tinyworld app. I have created a MTA project, afterward added both HDB and Node.js modules into the project. CF configurations on the workspace are done, too.

On the day I asked this question, though I click "Run > Run as Node.js Application", it was trying to run it in the Neo destination. I was able to see the app instance in the Neo applications.

But surprisingly today, just before trying again, it notified me saying the builder is outdated. I updated the builder, created the node.js module again. Right click on the tinyjs folder, "Run > Run as Node.js Application" and now it runs on CF destination! So this is what I wanted to see 🙂

Finally, I think it was a builder issue since things are changing super fast. However, I'm open to any suggestions.

Hope I'm clearer this time!

Thanks,

Ceyhun

mariusobert
Developer Advocate
Developer Advocate

Hi Ceyhun,

you are right, the Web IDE is a service provided from within the Neo environment. But at the end of the day, this shouldn't make a difference, you can see it as an independent web-based IDE which is able to deploy your applications to CF and Neo.

Our teams release a new version of the builder quite frequently (which is great!), so it is possible that you used a version which didn't work for some corner cases.

Anyway, I'm glad you were able to solve the issue. Have fun developing on the web IDE!

Regards,

Marius