Check out what's in the latest release of Kabanero Learn More

Appsody Hello World on Codewind

Prerequisites

  1. Codewind on Visual Studio Code or Eclipse

  2. Appsody

  3. Appsody Extension for Codewind

Getting started with VS Code

Creating a Java MicroProfile appsody Project

In VS Code open the command palette and navigate to the option Codewind: Create New Project. Select the Appsody Java MicroProfile template, give it a name and press enter. Navigate to the Explorer view. In the Explorer view keep expanding the Codewind section until the project you created is visible. At this point you can click the box with arrow icon next to the project to open it up in a browser, or the information icon to view the project overview.

The base url that you will be directed to doesn’t have any information yet. However appending /health will display the health of the container. Other built in endpoints are described on the bottom of the application stack’s README

NOTE: The project might still be starting and you’ll need to wait for it to be running.

Getting started with Eclispe

Creating a Java MicroProfile appsody Project

Open up the Codwind Explorer in your Eclipse workspace by clicking Window → Show View → Other…​ → Codewind → Codewind Explorer. Right click on the Local Projects under Codewind and select New Project. Select the Appsody Java MicroProfile template, give it a name and create it. Now underneath your Codewind → Local Projects, there should be your project. You can right click on the project and "Open Application" to view your app in your browser.

The base url that you will be directed to doesn’t have any information yet. However appending /health will display the health of the container. Other built in endpoints are described on the bottom of the application stack’s README

NOTE: The project might still be starting and you’ll need to wait for it to be running. Also you might need to refresh the project explorer to see the contents of your project directory.

Hello World

Create the index.html

Right-click on the appsody project and chose the option to Open Folder as Workspace. In the project workspace, navigate to src/main/webapp/ and create a new file there called index.html. Open the file and add Hello World. Save the file and click the icon to open the app in your web browser again. You should see a webpage with Hello World. Now you can go back to the file and change it, save it, and then refresh the webpage. The webpage will now be displaying your change.

While this is only a basic Hello World html file, this same process goes for any changes in the project you want to make.

Debugging

You can debug these applications as you would any other Codewind project.

Find more info on debugging Codewind applications in VS Code here and debugging in Eclipse here