Skip to content
This repository was archived by the owner on Nov 28, 2022. It is now read-only.

Commit 6346d15

Browse files
committed
changed metadata, omitted developing with Codewind content so the guide solely focuses on installing CodeReady Workspaces and setting up a Codewind workspace
Signed-off-by: Jacob Berger <jacob.berger@ibm.com>
1 parent 05cdd97 commit 6346d15

File tree

1 file changed

+10
-117
lines changed

1 file changed

+10
-117
lines changed

docs/_guides/codewind-crw-quick-guide.md

Lines changed: 10 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,16 @@ layout: guide
33
summary_title: "Codewind in CodeReady Workspaces"
44
title: "Getting Started with Codewind in CodeReady Workspaces"
55
categories: guides
6-
guide_description: "Use Codewind in CodeReady Workspaces to build high quality cloud native applications."
6+
description: "Use CodeReady Workspaces to develop cloud-native applications from an OpenShift cluster."
77
permalink: codewind-crw-quick-guide.html
8-
duration: 15 minutes
9-
tags: Codewind, CodeReady Workspaces, Openshift, Kubernetes, containers, microservice
10-
---
11-
12-
## Objectives
13-
* Install CodeReady Workspaces and Codewind
14-
* Develop a simple microservice that uses Eclipse Codewind on CodeReady Workspaces
8+
duration: 10 minutes
9+
keywords: Codewind, CodeReady Workspaces, OpenShift
10+
objectives: ["Install CodeReady Workspaces and Codewind.", "Create a Codewind workspace within CodeReady Workspaces."]
11+
icon: images/learn/icon_cloud.svg
12+
---
1513

1614
## Overview
17-
Use Eclipse Codewind to develop microservice applications from application stacks in an integrated developer environment (IDE). CodeReady Workspaces provides a containerized IDE for cloud native application development on an OpenShift cluster.
15+
Use Eclipse Codewind to develop microservice applications from application stacks in an integrated developer environment (IDE). CodeReady Workspaces provides a containerized IDE for cloud-native application development on an OpenShift cluster.
1816

1917
## Developing with CodeReady Workspaces
2018
CodeReady Workspaces uses Kubernetes and containers to provide a preconfigured environment. Use CodeReady Workspaces to create, build, and test your code in OpenShift containers but feel like you are working on an IDE on your local machine.
@@ -27,7 +25,7 @@ Each Codewind workspace also requires at least one 5Gi ReadWriteMany (RWX) persi
2725
Before you can use Codewind with CodeReady Workspaces, you must have an OpenShift cluster available.
2826

2927
### Installing CodeReady Workspaces
30-
1\. Log in to your OpenShift console's dashboard.
28+
1\. Log in to your OpenShift cluster's dashboard.
3129

3230
2\. From the sidebar, click **Operators** then **OperatorHub**.
3331

@@ -125,116 +123,11 @@ After you set up Codewind, log in to your CodeReady Workspaces account and creat
125123

126124
6\. Click **Create & Open**.
127125

128-
### Configuring Codewind to use application stacks
129-
Configure Codewind to use Appsody templates so you can focus exclusively on your code. Complete the following steps to select the Appsody templates:
130-
131-
1. Select **Codewind**.
132-
2. Right-click **Projects**.
133-
3. Select **Template Source Manager**.
134-
4. Enable **Appsody Stacks - incubator** and **Default templates**.
135-
136-
After you configured Codewind to use Appsody templates, continue to develop your microservice within Codewind.
137-
138-
### Creating an Appsody project
139-
Throughout the application lifestyle, Appsody helps you develop containerized applications and maximize containers curated for your usage.
140-
141-
1. Under the Explorer pane, select **Codewind**.
142-
2. Expand **Codewind** by clicking the drop-down arrow.
143-
3. Hover over the **Projects** entry underneath Codewind in the Explorer pane, and press the **+** icon to create a project.
144-
* **Note:** Make sure that Docker is running. Otherwise, you get an error.
145-
4. Choose the **Appsody Open Liberty default template (Appsody Stacks - incubator)**.
146-
5. Name your project **appsody-calculator**.
147-
* If you don't see Appsody templates, find and select **Template Source Manager** and enable **Appsody Stacks - incubator**.
148-
* The templates are refreshed, and the Appsody templates are available.
149-
6. Press **Enter**.
150-
* To monitor your project's progress, right-click your project, and select **Show all logs**. Then, an **Output** tab is displayed where you see your project's build logs.
151-
152-
Your project is complete when you see that your application status is running and your build status is successful.
153-
154-
### Accessing the application endpoint in a browser
155-
1. Return to your project under the **Explorer** pane.
156-
2. Select the Open App icon next to your project's name, or right-click your project and select **Open App**.
157-
158-
Your application is now opened in a browser, showing the welcome to your Appsody microservice page.
159-
160-
### Adding a REST service to your application
161-
1. Go to your project's workspace under the **Explorer** pane.
162-
2. Go to `src`>`main`>`java`>`dev`>`appsody`>`starter`.
163-
3. Right-click **starter** and select **New File**.
164-
4. Create a file, name it `Calculator.java`, and press **Enter**. This file is your JAX-RS resource.
165-
5. Before you input any code, make sure that the file is empty.
166-
6. Populate the file with the following code and then **save** the file:
167-
168-
```java
169-
package dev.appsody.starter;
170-
171-
import javax.ws.rs.core.Application;
172-
import javax.ws.rs.GET;
173-
import javax.ws.rs.Path;
174-
import javax.ws.rs.Produces;
175-
import javax.ws.rs.core.MediaType;
176-
import javax.ws.rs.core.Response;
177-
178-
import javax.ws.rs.PathParam;
179-
180-
@Path("/calculator")
181-
public class Calculator extends Application {
182-
183-
@GET
184-
@Path("/aboutme")
185-
@Produces(MediaType.TEXT_PLAIN)
186-
public String aboutme() {
187-
return "You can add (+), subtract (-), and multiply (*) with this simple calculator.";
188-
}
189-
190-
@GET
191-
@Path("/{op}/{a}/{b}")
192-
@Produces(MediaType.TEXT_PLAIN)
193-
public Response calculate(@PathParam("op") String op, @PathParam("a") String a, @PathParam("b") String b) {
194-
int numA = Integer.parseInt(a);
195-
int numB = Integer.parseInt(b);
196-
197-
switch (op) {
198-
case "+":
199-
return Response.ok(a + "+" + b + "=" + (Integer.toString((numA + numB)))).build();
200-
201-
case "-":
202-
return Response.ok(a + "-" + b + "=" + (Integer.toString((numA - numB)))).build();
203-
204-
case "*":
205-
return Response.ok(a + "*" + b + "=" + (Integer.toString((numA * numB)))).build();
206-
207-
default:
208-
return Response.ok("Invalid operation. Please Try again").build();
209-
}
210-
}
211-
}
212-
```
213-
214-
Any changes that you make to your code are automatically built and redeployed by Codewind, and you can view them in your browser.
215-
216-
### Working with the example calculator microservice
217-
You now can work with the example calculator microservice.
218-
219-
1. Use the URL that you saw when you first opened the application.
220-
2. Make sure to remove the `< >` symbol in the URL.
221-
3. `<url>/starter/calculator/aboutme`
222-
4. You see the following response:
223-
224-
```
225-
You can add (+), subtract (-), and multiply (*) with this simple calculator.
226-
```
227-
228-
You can also try a few of the sample calculator functions:
229-
230-
* `<url>/starter/calculator/{op}/{a}/{b}`, where you can input one of the available operations `(+, _, *)`, and an integer a, and an integer b.
231-
* So for `<url>/starter/calculator/+/10/3` you see: `10+3=13`.
232-
233126
## What you have learned
234127
Now that you have completed this quick guide, you have learned to:
235128

236-
1. Install CodeReady Workspaces and Codewind
237-
2. Develop your own microservice that uses Codewind on CodeReady Workspaces
129+
1. Install CodeReady Workspaces and Codewind.
130+
2. Create a Codewind workspace within CodeReady Workspaces.
238131

239132
## Next Steps
240133
See other quick guides to learn how to develop with Codewind:

0 commit comments

Comments
 (0)