简体   繁体   中英

Bluemix: Java Rest API starter app

I want to run and deploy a java rest API code on Bluemix. This is more to understand the Devops capabilities in conjunction with API management.

I tried to use this: http://www.codingpedia.org/ama/tutorial-rest-api-design-and-implementation-in-java-with-jersey-and-spring/

But could not push it to Bluemix. May I get some support?

Update:

When I push it to Bluemix, I get an error saying it could not find appropriate runtime.

Reading your comments you are searching for some pointers to create a starter Java REST application (possibly integrating a delivery pipeline).

You can start creating an application on Bluemix using the Liberty for Java runtime . Then you can, from your application dashboard, click on "Add Git" to create a Git repository on IBM Bluemix DevOps Services (IDS). Now you have your starter application running on Bluemix and its code hosted on IDS. You can edit the code directly on the Web IDE of IDS (clicking on " Edit Code ") and from there push the new versions of the applcation on Bluemix or you can clone the repository on your local environment (for example using the Eclipse Tools for Bluemix ) and deploy directly from your machine to Bluemix.

Using the first option you will be able to quickly setup a delivery pipeline using the "Build & Deploy" button, and use the DevOps capabilities of IDS. The Build & Deploy feature, also known as the pipeline, automates the continuous deployment of your projects. In a project's pipeline, sequences of stages retrieve input and run jobs, such as builds, tests, and deployments.

To add REST capabilities to the sample application you can for example use JAX-RS 2.0. Take a look here .

Javaee jax-rs REST API starter

Use my java REST API starter for bluemix. This uses javaee + jax-rs + swagger Just fork it, run pom.xml to generate war and push the war file to bluemix. Works like a charm

https://github.com/sanketsw/jax_rs_REST_Example

Spring boot REST API starter for bluemix

if you want a spring boot REST API starter, you can use the following boilerplate. This is a netflix eureka client but you can ignore eureka annotations. The REST API will work seamlessly anyway

https://github.com/sanketsw/Netflix_Eureka_Client_Hello_World

Another cleaner springboot REST API starter is here: https://github.com/sanketsw/SpringBoot_REST_API

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM