This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class App { | |
private static Consul consul; | |
private static final String SERVICE_ID = "ping-pong-1-id"; | |
public static void main(String[] args) { | |
port(8000); | |
consul = Consul.builder().withHostAndPort(HostAndPort.fromParts(System.getenv("host"), 8500)) | |
.build(); | |
AgentClient agentClient = consul.agentClient(); | |
registerOnConsul(agentClient); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:profiles {:dev {:dependencies [[figwheel-sidecar "0.5.18"] | |
[cider/piggieback "0.4.0"]] | |
:source-paths ["src" "env/dev"] | |
:cljsbuild {:builds [ | |
{:id "ios" | |
:source-paths ["src" "env/dev"] | |
:figwheel true | |
:compiler {:output-to "target/ios/index.js" | |
:main "env.ios.main" | |
:output-dir "target/ios" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn app-root [] | |
(let [greeting (subscribe [:get-greeting])] | |
(fn [] | |
[view {:style {:flex-direction "column" :margin 40 :align-items "center"}} | |
[text {:style {:font-size 30 :font-weight "100" :margin-bottom 20 :text-align "center"}} @greeting] | |
[image {:source logo-img | |
:style {:width 80 :height 80 :margin-bottom 30}}] | |
[touchable-highlight {:style {:background-color "#13DD1C" :padding 10 :border-radius 5} | |
:on-press #(alert "Hello from clojure!")} | |
[text {:style {:color "white" :text-align "center" :font-weight "bold"}} "press me"]]]))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clusters: | |
- name: ping_pong_service | |
connect_timeout: 0.25s | |
type: logical_dns | |
http2_protocol_options: {} | |
lb_policy: round_robin | |
hosts: [{ socket_address: { address: host.docker.internal, port_value: 8080 }}] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
virtual_hosts: | |
- name: local_service | |
domains: ["*"] | |
routes: | |
- match: { prefix: "/" } | |
route: | |
cluster: ping_pong_service | |
max_grpc_timeout: 0s | |
cors: | |
allow_origin: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
listeners: | |
- name: listener_0 | |
address: | |
socket_address: { address: 0.0.0.0, port_value: 9090 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
admin: | |
access_log_path: /tmp/admin_access.log | |
address: | |
socket_address: { address: 0.0.0.0, port_value: 9901 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var grpc = require('grpc'); | |
var pingPongProto = grpc.load('ping_pong.proto'); | |
var server = new grpc.Server(); | |
server.addService(pingPongProto.pingpong.PingPongService.service, { | |
pingPong: function(call,callback) { | |
console.log("Request") | |
return callback(null,{pong:"Pong"}) | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
admin: | |
access_log_path: /tmp/admin_access.log | |
address: | |
socket_address: { address: 0.0.0.0, port_value: 9901 } | |
static_resources: | |
listeners: | |
- name: listener_0 | |
address: | |
socket_address: { address: 0.0.0.0, port_value: 9090 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM envoyproxy/envoy-dev:latest | |
COPY ./envoy.yaml /etc/envoy/envoy.yaml | |
CMD /usr/local/bin/envoy -c /etc/envoy/envoy.yaml -l trace --log-path /tmp/envoy_info.log |