Dave Syer
10 years ago
5 changed files with 67 additions and 42 deletions
@ -1,44 +1,6 @@
@@ -1,44 +1,6 @@
|
||||
Ths project provides Netflix OSS integrations for Spring Boot apps through autoconfiguration |
||||
and binding to the Spring Environment and other Spring programming model idioms. |
||||
include::intro.adoc[] |
||||
|
||||
# Eureka Clients |
||||
|
||||
Example eureka client: |
||||
|
||||
``` |
||||
@Configuration |
||||
@ComponentScan |
||||
@EnableAutoConfiguration |
||||
@RestController |
||||
public class Application { |
||||
|
||||
@RequestMapping("/") |
||||
public String home() { |
||||
return "Hello world"; |
||||
} |
||||
|
||||
public static void main(String[] args) { |
||||
new SpringApplicationBuilder(Application.class).web(true).run(args); |
||||
} |
||||
|
||||
} |
||||
|
||||
``` |
||||
|
||||
(i.e. utterly normal Spring Boot app). Configuration is required to locate the Eureka server. Example: |
||||
|
||||
``` |
||||
eureka: |
||||
client: |
||||
serviceUrl: |
||||
defaultZone: http://localhost:8080/v2/ |
||||
default.defaultZone: http://localhost:8080/v2/ |
||||
``` |
||||
|
||||
The default application name, virtual host and non-secure port are taken from the `Environment` is |
||||
`${spring.application.name}`, `${spring.application.name}.mydomain.net` and `${server.port}` respectively. |
||||
|
||||
# TODO List |
||||
== TODO List |
||||
|
||||
- [x] Example front end app (currently in sandbox) |
||||
- [x] Example back end service (currently in sandbox) |
@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
|
||||
This project provides Netflix OSS integrations for Spring Boot apps through autoconfiguration |
||||
and binding to the Spring Environment and other Spring programming model idioms. |
||||
|
@ -0,0 +1,10 @@
@@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env ruby |
||||
|
||||
base_dir = File.join(File.dirname(__FILE__),'../../..') |
||||
src_dir = File.join(base_dir, "/src/main/asciidoc") |
||||
require File.join(File.dirname(__FILE__), 'readme.rb') |
||||
|
||||
options = {} |
||||
ARGV.length > 0 and options[:to_file] = ARGV[0] |
||||
|
||||
SpringCloud::Build.render_file("#{src_dir}/README.adoc", options) |
@ -0,0 +1,51 @@
@@ -0,0 +1,51 @@
|
||||
module SpringCloud |
||||
module Build |
||||
|
||||
IncludeDirectiveRx = /^\\?include::([^\[]+)\[(.*?)\]$/ |
||||
|
||||
class << self |
||||
|
||||
def process_include out, src, target, attrs |
||||
unless target.start_with?('/') |
||||
target = File.new(File.join(src, target)) |
||||
else |
||||
target = File.new(target) |
||||
end |
||||
target.each do |line| |
||||
self.process(out, File.dirname(target), line) |
||||
end |
||||
end |
||||
|
||||
def process out, src, line |
||||
if ((escaped = line.start_with?('\\include::')) || line.start_with?('include::')) && (match = IncludeDirectiveRx.match(line)) |
||||
if escaped |
||||
out << line[1..-1] |
||||
else |
||||
self.process_include out, src, match[1], match[2].strip |
||||
end |
||||
else |
||||
out << line |
||||
end |
||||
end |
||||
|
||||
def render_file file, options = {} |
||||
|
||||
srcDir = File.dirname(file) |
||||
out = ["// Do not edit this file (go to #{file} instead)",""] |
||||
File.new(file).each do |line| |
||||
self.process(out, srcDir, line) |
||||
end |
||||
|
||||
unless options[:to_file] |
||||
puts out |
||||
else |
||||
writer = File.new(options[:to_file],'w+') |
||||
out.each { |line| writer.write(line) } |
||||
end |
||||
|
||||
end |
||||
|
||||
end |
||||
|
||||
end |
||||
end |
Loading…
Reference in new issue