blob: 80f2d0f4694f3b74bf48605c8ccc3c2ff5897ecb [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-112407000-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-112407000-2');
</script>
<!-- Google Tag Manager -->
<script>
(function (w, d, s, l, i) {
w[l] = w[l] || [];
w[l].push({
'gtm.start': new Date().getTime(),
event: 'gtm.js'
});
var f = d.getElementsByTagName(s)[0],
j = d.createElement(s),
dl = l != 'dataLayer' ? '&l=' + l : '';
j.async = true;
j.src =
'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', 'GTM-KS8HHSF');
</script>
<!-- End Google Tag Manager -->
<head>
<title>Getting Started with Codewind in CodeReady Workspaces | Codewind</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Use CodeReady Workspaces to develop cloud-native applications from an OpenShift cluster.">
<meta name="keywords" content="Codewind, CodeReady Workspaces, OpenShift"/>
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon/favicon-32x32.png">
<link href="https://fonts.googleapis.com/css?family=IBM+Plex+Sans:300,400,600&display=swap" rel="stylesheet">
<!-- Bootstrap CSS CDN -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="css/docs.css">
<link rel="stylesheet" href="css/learn.css">
<link rel="stylesheet" href="css/blog.css">
<link rel="stylesheet" href="css/guides.css">
<link rel="stylesheet" href="css/search.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/themes/prism.min.css">
</head>
<body data-spy="scroll" data-target="#toc">
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KS8HHSF"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<div class="main">
<!-- Bootstrap NavBar -->
<nav class="navbar navbar-expand-xl navbar-light cw-banner fixed-top" aria-label="topnav">
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse"
data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="/codewind/">
<img alt="Codewind logo image" title="Codewind logo image" src="images/header/header-logo.svg" class="cw-header-logo" alt="">
</a>
<div class="collapse navbar-collapse justify-content-end cw-navbar-padding" id="navbarNavDropdown">
<ul class="navbar-nav cw-navbar-nav">
<li class="nav-item cw-navbar-item cw-header-link-docs">
<a class="nav-link cw-nav-link cw-header-link-text" href="learn.html">Learn</a>
</li>
<li class="nav-item cw-navbar-item cw-header-link-news">
<a class="nav-link cw-nav-link cw-header-link-text" href="news.html">News</a>
</li>
<li class="nav-item cw-navbar-item cw-header-link-blog">
<a class="nav-link cw-nav-link cw-header-link-text" href="blog.html">Blog</a>
</li>
<li class="nav-item cw-navbar-item cw-header-link-guides">
<a class="nav-link cw-nav-link cw-header-link-text" href="guides.html">Guides</a>
</li>
<form class="form-inline my-2 my-lg-0 cw-navbar-item" action="/codewind/search.html" method="get">
<svg class="bi bi-search" width="1em" height="1em" viewBox="0 0 16 16" fill="black" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" d="M10.442 10.442a1 1 0 011.415 0l3.85 3.85a1 1 0 01-1.414 1.415l-3.85-3.85a1 1 0 010-1.415z" clip-rule="evenodd"/>
<path fill-rule="evenodd" d="M6.5 12a5.5 5.5 0 100-11 5.5 5.5 0 000 11zM13 6.5a6.5 6.5 0 11-13 0 6.5 6.5 0 0113 0z" clip-rule="evenodd"/>
</svg>
<input id="nav-search" class="form-control mr-sm-2" type="text" id="search-box" name="query" placeholder="Search">
</form>
<li class="nav-item cw-navbar-item cw-header-link">
<a class="nav-link cw-nav-link" href="https://github.com/eclipse/codewind"><img alt="Codewind Github" class="banner-image" title="Codewind Github" data-toggle="tooltip" data-placement="top" id="cw_github_stars" title="..." src="images/header/github.svg"/></a>
</li>
<li class="nav-item cw-navbar-item cw-header-link">
<a class="nav-link cw-nav-link" href="https://twitter.com/EclipseCodewind"><img alt="Codewind Twitter" class="banner-image" title="Codewind Twitter" src="images/header/twitter.png"/></a>
</li>
<li class="nav-item cw-navbar-item cw-header-link">
<a class="nav-link cw-nav-link" href="https://mattermost.eclipse.org/eclipse/channels/eclipse-codewind"><img alt="Codewind Mattermost" class="banner-image" title="Codewind Mattermost" src="images/header/mattermost.png"/></a>
</li>
<li class="nav-item cw-navbar-item cw-header-link">
<a class="nav-link cw-nav-link" href="https://www.youtube.com/channel/UCnKCVK6RFDyHFqUmXlAhCHQ"><img alt="Codewind YouTube" class="banner-image" title="Codewind YouTube" src="images/header/youtube.png"/></a>
</li>
<!-- li class="nav-item cw-navbar-item" id="download-li">
<button onClick="window.location.href='https://microclimate.dev/download/codewind';" type="button" class="btn cw-download-button">Download</button>
<a href="https://microclimate.dev/download/codewind" class="nav-link cw-nav-link cw-download-link" href="#">Download</a>
</li> -->
<!-- Smaller devices menu END -->
</ul>
</div>
</nav>
<!-- End Bootstrap NavBar -->
<div class="row" id="post-row">
<div class="col-xs-12 col-lg-1"></div>
<div class="py-5 px-5 col-xs-12 col-lg-10">
<div class="cw-blog-spacer"></div>
<div id="post-content">
<h1>Getting Started with Codewind in CodeReady Workspaces</h1>
<!--<p>20 Oct 2020</p>-->
<p>Use CodeReady Workspaces to develop cloud-native applications from an OpenShift cluster.</p>
<h2>Objectives</h2>
<ul>
<li>
Install CodeReady Workspaces and Codewind.
</li>
<li>
Create a Codewind workspace within CodeReady Workspaces.
</li>
<li>
Develop a simple microservice with the Codewind workspace.
</li>
</ul>
<div role="main"><h2 id="overview">Overview</h2>
<p>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.</p>
<h2 id="developing-with-codeready-workspaces">Developing with CodeReady Workspaces</h2>
<p>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.</p>
<h3 id="prerequisite">Prerequisite</h3>
<p>Before you can use Codewind with CodeReady Workspaces, you must have an OpenShift cluster available. To install OpenShift clusters, see <a href="https://code-ready.github.io/crc/">CodeReady Containers</a>.</p>
<p>CodeReady Workspaces require at least two 5Gi ReadWriteOnce (RWO) persistent volumes on the cluster to install and a 5Gi RWO volume for each created workspace.</p>
<p>Each Codewind workspace also requires at least one 5Gi ReadWriteMany (RWX) persistent volume.</p>
<h3 id="installing-codeready-workspaces">Installing CodeReady Workspaces</h3>
<p>1. Log in to your OpenShift cluster’s dashboard.</p>
<p>2. From the sidebar, click <strong>Operators</strong> then <strong>OperatorHub</strong>.</p>
<p>3. Search for <code class="highlighter-rouge">CodeReady Workspaces</code>.</p>
<p>4. Select <strong>Red Hat CodeReady Workspaces</strong>:</p>
<p><img src="./images/codereadyworkspaces-images/CRW-OperatorHub.png" alt="Subscribe to OperatorHub" width="900" />.</p>
<p>5. Click <strong>Install</strong>:</p>
<p><img src="./images/codereadyworkspaces-images/CRW-Install.png" alt="Install CodeReady Workspaces" width="800" />.</p>
<p>After you install the operator, continue to install CodeReady Workspaces:</p>
<p>1. From the OpenShift dashboard, go to <code class="highlighter-rouge">Operators</code>&gt;<code class="highlighter-rouge">Installed Operators</code>.</p>
<p>2. Select <strong>CodeReady Workspaces</strong>.</p>
<p>3. Select the <strong>CodeReady Workspaces</strong> cluster then <strong>Create CheCluster</strong>.</p>
<p>4. Configure the fields, like <strong>tlsSupport</strong>, as needed.</p>
<p>5. Copy and paste the following yaml into the provided text box:</p>
<div class="language-yaml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="na">apiVersion</span><span class="pi">:</span> <span class="s">org.eclipse.che/v1</span>
<span class="na">kind</span><span class="pi">:</span> <span class="s">CheCluster</span>
<span class="na">metadata</span><span class="pi">:</span>
<span class="na">name</span><span class="pi">:</span> <span class="s">codeready-workspaces</span>
<span class="na">spec</span><span class="pi">:</span>
<span class="na">server</span><span class="pi">:</span>
<span class="na">cheImageTag</span><span class="pi">:</span> <span class="s1">'</span><span class="s">'</span>
<span class="na">cheFlavor</span><span class="pi">:</span> <span class="s">codeready</span>
<span class="na">devfileRegistryImage</span><span class="pi">:</span> <span class="s1">'</span><span class="s">'</span>
<span class="na">pluginRegistryImage</span><span class="pi">:</span> <span class="s1">'</span><span class="s">'</span>
<span class="na">tlsSupport</span><span class="pi">:</span> <span class="no">true</span>
<span class="na">selfSignedCert</span><span class="pi">:</span> <span class="no">true</span>
<span class="na">cheWorkspaceClusterRole</span><span class="pi">:</span> <span class="s1">'</span><span class="s">eclipse-codewind'</span>
<span class="na">customCheProperties</span><span class="pi">:</span>
<span class="na">CHE_INFRA_KUBERNETES_WORKSPACE__START__TIMEOUT__MIN</span><span class="pi">:</span> <span class="s2">"</span><span class="s">15"</span>
<span class="na">CHE_LIMITS_WORKSPACE_IDLE_TIMEOUT</span><span class="pi">:</span> <span class="s2">"</span><span class="s">0"</span>
<span class="na">CHE_WORKSPACE_PLUGIN__BROKER_WAIT__TIMEOUT__MIN</span><span class="pi">:</span> <span class="s2">"</span><span class="s">15"</span>
<span class="na">database</span><span class="pi">:</span>
<span class="na">externalDb</span><span class="pi">:</span> <span class="no">false</span>
<span class="na">chePostgresHostName</span><span class="pi">:</span> <span class="s1">'</span><span class="s">'</span>
<span class="na">chePostgresPort</span><span class="pi">:</span> <span class="s1">'</span><span class="s">'</span>
<span class="na">chePostgresUser</span><span class="pi">:</span> <span class="s1">'</span><span class="s">'</span>
<span class="na">chePostgresPassword</span><span class="pi">:</span> <span class="s1">'</span><span class="s">'</span>
<span class="na">chePostgresDb</span><span class="pi">:</span> <span class="s1">'</span><span class="s">'</span>
<span class="na">auth</span><span class="pi">:</span>
<span class="na">openShiftoAuth</span><span class="pi">:</span> <span class="no">false</span>
<span class="na">identityProviderImage</span><span class="pi">:</span> <span class="s1">'</span><span class="s">'</span>
<span class="na">externalIdentityProvider</span><span class="pi">:</span> <span class="no">false</span>
<span class="na">identityProviderURL</span><span class="pi">:</span> <span class="s1">'</span><span class="s">'</span>
<span class="na">identityProviderRealm</span><span class="pi">:</span> <span class="s1">'</span><span class="s">'</span>
<span class="na">identityProviderClientId</span><span class="pi">:</span> <span class="s1">'</span><span class="s">'</span>
<span class="na">storage</span><span class="pi">:</span>
<span class="na">pvcStrategy</span><span class="pi">:</span> <span class="s">per-workspace</span>
<span class="na">pvcClaimSize</span><span class="pi">:</span> <span class="s">1Gi</span>
<span class="na">preCreateSubPaths</span><span class="pi">:</span> <span class="no">true</span>
</code></pre></div></div>
<p><img src="./images/codereadyworkspaces-images/CRW-CheCluster.png" alt="Install CheCluster" width="900" />.</p>
<ul>
<li><strong>Note:</strong> If you install CodeReady Workspaces on an OpenShift cluster with publicly signed certificates, such as on IBM Cloud, set <strong>selfSignedCert</strong> to <strong>false</strong>.</li>
</ul>
<p>6. After CodeReady Workspaces installs, click the <strong>CodeReady Workspaces URL</strong>.</p>
<p>7. A new window appears that prompts you to log in. If you have not made a CodeReady Workspaces account, do so by clicking <strong>Register</strong>:</p>
<p><img src="./images/codereadyworkspaces-images/CRW-Register.png" alt="Register an account" width="900" />.</p>
<p>8. After you make a CodeReady Workspaces account, you can start to create a Codewind workspace.</p>
<h3 id="setting-up-codewind">Setting up Codewind</h3>
<p>Because of its dependency on <code class="highlighter-rouge">buildah</code>, Codewind needs to run as root and privileged. To enable Codewind, run the following commands from your command line:</p>
<ul>
<li><code class="highlighter-rouge">oc adm policy add-scc-to-user anyuid system:serviceaccounts:&lt;namespace where you installed CodeReady Workspaces&gt;:che-workspace</code></li>
<li><code class="highlighter-rouge">oc adm policy add-scc-to-user privileged system:serviceaccounts:&lt;namespace where you installed CodeReady Workspaces&gt;:che-workspace</code></li>
</ul>
<p>CodeReady Workspaces starts Codewind and installs the Codewind plug-ins. This process might take a couple of minutes for all of the necessary components to be pulled and started.</p>
<h3 id="creating-the-codewind-workspace">Creating the Codewind workspace</h3>
<p>After you set up Codewind, log in to your CodeReady Workspaces account and create a Codewind workspace from the Codewind devfile:</p>
<p>1. Log in to CodeReady Workspaces.</p>
<p>2. Go to <strong>Workspaces</strong> then click <strong>Add Workspace</strong>.</p>
<p>3. Click <strong>Import Devfile</strong>.</p>
<p>4. From <strong>Source</strong>, click <strong>YAML</strong>.</p>
<p>5. Go to the link, <a href="https://raw.githubusercontent.com/eclipse/codewind-che-plugin/0.14.1/devfiles/0.14.1/devfile.yaml">codewind-che-plugin/0.14.1/devfile.yaml</a>, then copy and paste the contents into the YAML text box in your Codewind workspace.</p>
<p>6. Click <strong>Create &amp; Open</strong>.</p>
<h3 id="configuring-codewind-to-use-application-stacks">Configuring Codewind to use application stacks</h3>
<p>Configure Codewind to use Appsody templates so you can focus exclusively on your code. Complete the following steps to select the Appsody templates:</p>
<ol>
<li>Select <strong>Codewind</strong>.</li>
<li>Right-click <strong>Projects</strong>.</li>
<li>Select <strong>Template Source Manager</strong>.</li>
<li>Enable <strong>Appsody Stacks - incubator</strong> and <strong>Default templates</strong>.</li>
</ol>
<p>After you configured Codewind to use Appsody templates, continue to develop your microservice within Codewind.</p>
<h3 id="creating-an-appsody-project">Creating an Appsody project</h3>
<p>Throughout the application lifestyle, Appsody helps you develop containerized applications and maximize containers curated for your usage.</p>
<ol>
<li>Under the Explorer pane, select <strong>Codewind</strong>.</li>
<li>Expand <strong>Codewind</strong> by clicking the drop-down arrow.</li>
<li>Hover over the <strong>Projects</strong> entry underneath Codewind in the Explorer pane, and press the <strong>+</strong> icon to create a project.
<ul>
<li><strong>Note:</strong> Make sure that Docker is running. Otherwise, you get an error.</li>
</ul>
</li>
<li>Choose the <strong>Appsody Open Liberty default template (Appsody Stacks - incubator)</strong>.</li>
<li>Name your project <strong>appsody-calculator</strong>.
<ul>
<li>If you don’t see Appsody templates, find and select <strong>Template Source Manager</strong> and enable <strong>Appsody Stacks - incubator</strong>.</li>
<li>The templates are refreshed, and the Appsody templates are available.</li>
</ul>
</li>
<li>Press <strong>Enter</strong>.
<ul>
<li>To monitor your project’s progress, right-click your project, and select <strong>Show all logs</strong>. Then, an <strong>Output</strong> tab is displayed where you see your project’s build logs.</li>
</ul>
</li>
</ol>
<p>Your project is complete when you see that your application status is running and your build status is successful.</p>
<h3 id="accessing-the-application-endpoint-in-a-browser">Accessing the application endpoint in a browser</h3>
<ol>
<li>Return to your project under the <strong>Explorer</strong> pane.</li>
<li>Select the Open App icon next to your project’s name, or right-click your project and select <strong>Open App</strong>.</li>
</ol>
<p>Your application is now opened in a browser, showing the welcome to your Appsody microservice page.</p>
<h3 id="adding-a-rest-service-to-your-application">Adding a REST service to your application</h3>
<ol>
<li>Go to your project’s workspace under the <strong>Explorer</strong> pane.</li>
<li>Go to <code class="highlighter-rouge">src</code>&gt;<code class="highlighter-rouge">main</code>&gt;<code class="highlighter-rouge">java</code>&gt;<code class="highlighter-rouge">dev</code>&gt;<code class="highlighter-rouge">appsody</code>&gt;<code class="highlighter-rouge">starter</code>.</li>
<li>Right-click <strong>starter</strong> and select <strong>New File</strong>.</li>
<li>Create a file, name it <code class="highlighter-rouge">Calculator.java</code>, and press <strong>Enter</strong>. This file is your JAX-RS resource.</li>
<li>Before you input any code, make sure that the file is empty.</li>
<li>Populate the file with the following code and then <strong>save</strong> the file:</li>
</ol>
<div class="language-java highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kn">package</span> <span class="n">dev</span><span class="o">.</span><span class="na">appsody</span><span class="o">.</span><span class="na">starter</span><span class="o">;</span>
<span class="kn">import</span> <span class="nn">javax.ws.rs.core.Application</span><span class="o">;</span>
<span class="kn">import</span> <span class="nn">javax.ws.rs.GET</span><span class="o">;</span>
<span class="kn">import</span> <span class="nn">javax.ws.rs.Path</span><span class="o">;</span>
<span class="kn">import</span> <span class="nn">javax.ws.rs.Produces</span><span class="o">;</span>
<span class="kn">import</span> <span class="nn">javax.ws.rs.core.MediaType</span><span class="o">;</span>
<span class="kn">import</span> <span class="nn">javax.ws.rs.core.Response</span><span class="o">;</span>
<span class="kn">import</span> <span class="nn">javax.ws.rs.PathParam</span><span class="o">;</span>
<span class="nd">@Path</span><span class="o">(</span><span class="s">"/calculator"</span><span class="o">)</span>
<span class="kd">public</span> <span class="kd">class</span> <span class="nc">Calculator</span> <span class="kd">extends</span> <span class="nc">Application</span> <span class="o">{</span>
<span class="nd">@GET</span>
<span class="nd">@Path</span><span class="o">(</span><span class="s">"/aboutme"</span><span class="o">)</span>
<span class="nd">@Produces</span><span class="o">(</span><span class="nc">MediaType</span><span class="o">.</span><span class="na">TEXT_PLAIN</span><span class="o">)</span>
<span class="kd">public</span> <span class="nc">String</span> <span class="nf">aboutme</span><span class="o">()</span> <span class="o">{</span>
<span class="k">return</span> <span class="s">"You can add (+), subtract (-), and multiply (*) with this simple calculator."</span><span class="o">;</span>
<span class="o">}</span>
<span class="nd">@GET</span>
<span class="nd">@Path</span><span class="o">(</span><span class="s">"/{op}/{a}/{b}"</span><span class="o">)</span>
<span class="nd">@Produces</span><span class="o">(</span><span class="nc">MediaType</span><span class="o">.</span><span class="na">TEXT_PLAIN</span><span class="o">)</span>
<span class="kd">public</span> <span class="nc">Response</span> <span class="nf">calculate</span><span class="o">(</span><span class="nd">@PathParam</span><span class="o">(</span><span class="s">"op"</span><span class="o">)</span> <span class="nc">String</span> <span class="n">op</span><span class="o">,</span> <span class="nd">@PathParam</span><span class="o">(</span><span class="s">"a"</span><span class="o">)</span> <span class="nc">String</span> <span class="n">a</span><span class="o">,</span> <span class="nd">@PathParam</span><span class="o">(</span><span class="s">"b"</span><span class="o">)</span> <span class="nc">String</span> <span class="n">b</span><span class="o">)</span> <span class="o">{</span>
<span class="kt">int</span> <span class="n">numA</span> <span class="o">=</span> <span class="nc">Integer</span><span class="o">.</span><span class="na">parseInt</span><span class="o">(</span><span class="n">a</span><span class="o">);</span>
<span class="kt">int</span> <span class="n">numB</span> <span class="o">=</span> <span class="nc">Integer</span><span class="o">.</span><span class="na">parseInt</span><span class="o">(</span><span class="n">b</span><span class="o">);</span>
<span class="k">switch</span> <span class="o">(</span><span class="n">op</span><span class="o">)</span> <span class="o">{</span>
<span class="k">case</span> <span class="s">"+"</span><span class="o">:</span>
<span class="k">return</span> <span class="nc">Response</span><span class="o">.</span><span class="na">ok</span><span class="o">(</span><span class="n">a</span> <span class="o">+</span> <span class="s">"+"</span> <span class="o">+</span> <span class="n">b</span> <span class="o">+</span> <span class="s">"="</span> <span class="o">+</span> <span class="o">(</span><span class="nc">Integer</span><span class="o">.</span><span class="na">toString</span><span class="o">((</span><span class="n">numA</span> <span class="o">+</span> <span class="n">numB</span><span class="o">)))).</span><span class="na">build</span><span class="o">();</span>
<span class="k">case</span> <span class="s">"-"</span><span class="o">:</span>
<span class="k">return</span> <span class="nc">Response</span><span class="o">.</span><span class="na">ok</span><span class="o">(</span><span class="n">a</span> <span class="o">+</span> <span class="s">"-"</span> <span class="o">+</span> <span class="n">b</span> <span class="o">+</span> <span class="s">"="</span> <span class="o">+</span> <span class="o">(</span><span class="nc">Integer</span><span class="o">.</span><span class="na">toString</span><span class="o">((</span><span class="n">numA</span> <span class="o">-</span> <span class="n">numB</span><span class="o">)))).</span><span class="na">build</span><span class="o">();</span>
<span class="k">case</span> <span class="s">"*"</span><span class="o">:</span>
<span class="k">return</span> <span class="nc">Response</span><span class="o">.</span><span class="na">ok</span><span class="o">(</span><span class="n">a</span> <span class="o">+</span> <span class="s">"*"</span> <span class="o">+</span> <span class="n">b</span> <span class="o">+</span> <span class="s">"="</span> <span class="o">+</span> <span class="o">(</span><span class="nc">Integer</span><span class="o">.</span><span class="na">toString</span><span class="o">((</span><span class="n">numA</span> <span class="o">*</span> <span class="n">numB</span><span class="o">)))).</span><span class="na">build</span><span class="o">();</span>
<span class="k">default</span><span class="o">:</span>
<span class="k">return</span> <span class="nc">Response</span><span class="o">.</span><span class="na">ok</span><span class="o">(</span><span class="s">"Invalid operation. Please Try again"</span><span class="o">).</span><span class="na">build</span><span class="o">();</span>
<span class="o">}</span>
<span class="o">}</span>
<span class="o">}</span>
</code></pre></div></div>
<p>Any changes that you make to your code are automatically built and redeployed by Codewind, and you can view them in your browser.</p>
<h3 id="working-with-the-example-calculator-microservice">Working with the example calculator microservice</h3>
<p>You now can work with the example calculator microservice.</p>
<ol>
<li>Use the URL that you saw when you first opened the application.</li>
<li>Make sure to remove the <code class="highlighter-rouge">&lt; &gt;</code> symbol in the URL.</li>
<li><code class="highlighter-rouge">&lt;url&gt;/starter/calculator/aboutme</code></li>
<li>You see the following response:</li>
</ol>
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>You can add (+), subtract (-), and multiply (*) with this simple calculator.
</code></pre></div></div>
<p>You can also try a few of the sample calculator functions:</p>
<ul>
<li><code class="highlighter-rouge">&lt;url&gt;/starter/calculator/{op}/{a}/{b}</code>, where you can input one of the available operations <code class="highlighter-rouge">(+, _, *)</code>, and an integer a, and an integer b.</li>
<li>So for <code class="highlighter-rouge">&lt;url&gt;/starter/calculator/+/10/3</code> you see: <code class="highlighter-rouge">10+3=13</code>.</li>
</ul>
<h2 id="what-you-have-learned">What you have learned</h2>
<p>Now that you have completed this quick guide, you have learned to:</p>
<ol>
<li>Install CodeReady Workspaces and Codewind.</li>
<li>Create a Codewind workspace within CodeReady Workspaces.</li>
<li>Develop a simple microservice with the Codewind workspace.</li>
</ol>
<h2 id="next-steps">Next Steps</h2>
<p>See other quick guides to learn how to develop with Codewind:</p>
<ul>
<li><a href="codewind-eclipse-quick-guide.html">Codewind in Eclipse</a></li>
<li><a href="https://www.eclipse.org/codewind/codewind-vscode-quick-guide.html">Codewind in VS Code</a></li>
</ul>
</div>
</div>
</div>
<div class="col-xs-12 col-lg-1"></div>
</div>
<!-- footer row -->
<footer>
<div id="footer-div-mobile">
<div class="row">
<div class="col-sm-12 text-center">
<span>Useful Links:</span>
<br/><br/>
<a class="cw-footer-links" href="http://www.eclipse.org">Eclipse Foundation</a><br/>
<a class="cw-footer-links" href="http://www.eclipse.org/legal/privacy.php">Privacy Policy</a><br/>
<a class="cw-footer-links" href="http://www.eclipse.org/legal/termsofuse.php">Website Terms of Use</a><br/>
<a class="cw-footer-links" href="http://www.eclipse.org/legal/copyright.php">Copyright Agent</a><br/>
<a class="cw-footer-links" href="http://www.eclipse.org/legal">Legal</a><br/>
</div>
</div>
<div class="cw_footer_display_flex cw-footer-same-height cw-footer-center">
<div class="cw_footer_display_icons row">
<div class="cw-footer-col text-center col-md-3 col-sm-6 col-xs-12">
<div>
<div>
<a href="mailto:codewind-dev@eclipse.org"><img alt="Send us an email" title="Send us an email" src="images/footer/email-icon.svg" class="cw-logo" /></a>
</div>
</div>
</div>
<div class="cw-footer-col text-center col-md-3 col-sm-6 col-xs-12">
<div>
<div>
<a href="https://twitter.com/EclipseCodewind"><img alt="Codewind Twitter" title="Codewind Twitter" src="images/footer/twitter-logo.svg" class="cw-logo" /></a>
</div>
</div>
</div>
<div class="cw-footer-col text-center col-md-3 col-sm-6 col-xs-12">
<div>
<div>
<a href="https://github.com/eclipse/codewind"><img alt="Codewind Github" title="Codewind Github" src="images/footer/github-logo.svg"
class="cw-logo" /></a>
</div>
</div>
</div>
<div class=" cw-footer-col text-center col-md-3 col-sm-6 col-xs-12">
<div>
<div>
<a href="https://mattermost.eclipse.org/eclipse/channels/eclipse-codewind"><img alt="Codewind Mattermost" title="Codewind Mattermost" src="images/footer/mattermost-logo.png" class="cw-logo-mm" /></a>
</div>
</div>
</div>
<div class="cw-footer-col text-center col-md-3 col-sm-6 col-xs-12">
<div>
<div>
<a href="https://www.youtube.com/channel/UCnKCVK6RFDyHFqUmXlAhCHQ"><img alt="Codewind YouTube" title="Codewind YouTube" src="images/footer/youtube-logo-dark.svg"
class="cw-logo" /></a>
</div>
</div>
</div>
<div class="cw-footer-col text-center col-md-3 col-sm-6 col-xs-12">
<div>
<div>
<a href="http://www.eclipse.org"><img class="cw-logo-eclipse-mobile" alt="Eclipse" title="Eclipse" src="images/footer/eclipse.svg"/></a>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row cw-footer-desktop" id="footer-div">
<div class="cw-footer-left">
<div class="px-5 cw-font-12>
<span class="cw-font-14">Useful Links:</span>
<br/><br/>
<a class="cw-footer-links" href="http://www.eclipse.org">Eclipse Foundation</a><br/>
<a class="cw-footer-links" href="http://www.eclipse.org/legal/privacy.php">Privacy Policy</a><br/>
<a class="cw-footer-links" href="http://www.eclipse.org/legal/termsofuse.php">Website Terms of Use</a><br/>
<a class="cw-footer-links" href="http://www.eclipse.org/legal/copyright.php">Copyright Agent</a><br/>
<a class="cw-footer-links" href="http://www.eclipse.org/legal">Legal</a><br/>
</div>
</div>
<div class="cw-footer-border-right"></div>
<div class="cw_footer_display_flex cw-footer-same-height cw-footer-center">
<div class="cw_footer_display_icons">
<div class="cw-footer-col text-center">
<div>
<div>
<a href="mailto:codewind-dev@eclipse.org"><img alt="Send us an email" title="Send us an email" src="images/footer/email-icon.svg" class="cw-logo" /></a>
</div>
</div>
</div>
<div class="cw-footer-col text-center">
<div>
<div>
<a href="https://twitter.com/EclipseCodewind"><img alt="Codewind Twitter" title="Codewind Twitter" src="images/footer/twitter-logo.svg" class="cw-logo" /></a>
</div>
</div>
</div>
<div class="cw-footer-col text-center">
<div>
<div>
<a href="https://github.com/eclipse/codewind"><img alt="Codewind Github" title="Codewind Github" src="images/footer/github-logo.svg"
class="cw-logo" /></a>
</div>
</div>
</div>
<div class=" cw-footer-col text-center">
<div class="cw-logo-mm" >
<div class="cw-logo-mm" >
<a href="https://mattermost.eclipse.org/eclipse/channels/eclipse-codewind"><img alt="Codewind Mattermost" title="Codewind Mattermost" src="images/footer/mattermost-logo.png" class="cw-logo-mm" /></a>
</div>
</div>
</div>
<div class="cw-footer-col text-center">
<div>
<div>
<a href="https://www.youtube.com/channel/UCnKCVK6RFDyHFqUmXlAhCHQ"><img alt="Codewind YouTube" title="Codewind YouTube" src="images/footer/youtube-logo-dark.svg"
class="cw-logo" /></a>
</div>
</div>
</div>
</div>
</div>
<div class="cw-footer-border-right"></div>
<div class="cw-footer-right cw-footer-same-height cw-footer-vcenter">
<div class="cw-footer-eclipse-img cw-footer-same-height px-5 ">
<a href="http://www.eclipse.org">
<img alt="Eclipse" title="Eclipse" src="images/footer/eclipse.svg"/>
</a>
</div>
</div>
</div>
</footer>
<!-- footer row END -->
<!-- Jquery -->
<script
src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous">
</script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous">
</script>
<!-- Font Awesome JS -->
<script defer src="https://use.fontawesome.com/releases/v5.0.13/js/solid.js"
integrity="sha384-tzzSw1/Vo+0N5UhStP3bvwWPq+uvzCMfrN1fEFe+xBmv1C/AtVX5K0uZtmcHitFZ" crossorigin="anonymous">
</script>
<script defer src="https://use.fontawesome.com/releases/v5.0.13/js/fontawesome.js"
integrity="sha384-6OIrr52G08NpOFSZdxxz1xdNSndlD4vdcf/q2myIUVO0VsqaGHJsB0RaBE01VTOY" crossorigin="anonymous">
</script>
<script src="js/jquery.matchHeight-min.js"></script>
<script src="js/index.js"></script>
<script src="js/docs.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/prism.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/components/prism-docker.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/components/prism-json.min.js"></script>
</div>
</body>
</html>