Giter Site home page Giter Site logo

mircoservice's Introduction

Contact

Develop

Coverage Report

  • Execute mvn cobertura:cobertura -Dcobertura.report.format=html at console.
  • See the detailed coverage report in the folder of each sub project. The path of the report folder is subproject:target/site/

Swagger UI

Code Style

  • Eclipse -> Preferences -> Java -> Code Style -> Formatter -> Import microservice/eclipse-java-style.xml
  • In Eclipse, in the Package Explorer, right-click on the top-level package of the project. Choose Source > Organize Imports, and you're done, for all the files in your project.

idea code style

下载EclipseCodeFormat 插件安装,重启导入eclipse-java-style.xml配置 ieda:eclipse-java-style.xml

show symbol

  • Eclipse->window->Preferences->General->Editors->Text Editors->show whitespace characters(configure visibility)

TestNG

  • Go to Eclipse -> Help -> Eclipse Marketplace.
  • Find "TestNG", and install.

Running the Examples

To follow the simple Spring Boot example (project name:test-demo):

  • in a new file called HelloController.java:
@RestController
public class HelloController {
    @RequestMapping("/index")
    public String index() {
        return "Greetings from Spring Boot!";
    }
}
  • in another new file called Application.java:
@SpringBootApplication
public class Application {
    public static void main(String[] args) {
        ApplicationContext ctx = SpringApplication.run(Application.class, args);
        System.out.println("Let's inspect the beans provided by Spring Boot:");
        String[] beanNames = ctx.getBeanDefinitionNames();
        Arrays.sort(beanNames);
        for (String beanName : beanNames) {
            System.out.println(beanName);
        }
    }
}
  • from the terminal in the project directory ,you can execute mvn package
  • you'll be given a test-demo.jar that you can execute: java -jar test-demo.jar
  • you can test the api /index in the browser

Pushing to Cloud Foundry

  • cf login to ensure that you've authenticated against your Pivotal Web Services account. My session looked like this, yours will feature your own Cloud Foundry credentials.
> cf login

API endpoint> api.run.test.io

Email> [email protected]

Password>
Authenticating...
OK

Select an org (or press enter to skip):
1. org-xxx-test
2. org-xxx

Org> 1
Targeted org org-xxx-test

Targeted space space-devtest1


API endpoint:   https://api.run.test.io
User:           [email protected]
Org:            org-xxx-test
Space:          space-devtest1

  • create a new file named manifest.yml in the project directory
---
applications:
- name: test-demo
  memory: 2048m
  instances: 1
  disk_quota: 2048m
  host: test-demo
  domain: xxx.cn
  path: ./target/test-demo-0.1.0.jar
  stack: cflinuxfs2
  buildpack: java_buildpack_new
  • cf push -f manifest.yml
  • the SOME_NAME_YOU_MAKEUP_HERE is arbitrary; it'll inform the URL that's used to mount the application and as such it shares a shared global (DNS) namespace

mircoservice's People

Contributors

nbfcome avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.