Skip to content

Commit

Permalink
fix(runtime): fix local startup config
Browse files Browse the repository at this point in the history
  • Loading branch information
jghamburg committed Sep 6, 2019
1 parent 7ea64b4 commit 3dfd0a4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
File renamed without changes.
8 changes: 8 additions & 0 deletions src/main/resources/bootstrap-k8s.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
spring:
application:
name: lsb2-chat
cloud:
config:
label: session
password: password
uri: ${CONFIG_SERVER_URI:http://lsb2-config-server}
2 changes: 1 addition & 1 deletion src/main/resources/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ spring:
config:
label: session
password: password
uri: ${CONFIG_SERVER_URI:http://lsb2-config-server:8080}
uri: ${CONFIG_SERVER_URI:http://localhost:8888}
7 changes: 4 additions & 3 deletions src/main/resources/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ <h1>Learning Spring Boot - 2nd Edition</h1>
<script th:inline="javascript">
/*<![CDATA[*/
(function() {
var webServiceUrl = 'ws://lsb2-chat.local.svc.cluster.local';
// Send in new comments via an AJAX call
document.querySelectorAll('button.comment').forEach(function (button) {
button.addEventListener('click', function () {
Expand All @@ -134,7 +135,7 @@ <h1>Learning Spring Boot - 2nd Edition</h1>
});

// Listen for new comments
var newComments = new WebSocket('ws://lsb2-chat.local.svc.cluster.local/topic/comments.new');
var newComments = new WebSocket(webServiceUrl + '/topic/comments.new');
newComments.onmessage = function(event) {
console.log('Received ' + event.data + '!');
var parsedMessage = JSON.parse(event.data);
Expand All @@ -147,7 +148,7 @@ <h1>Learning Spring Boot - 2nd Edition</h1>
}

<!-- tag::chat-2[] -->
var outboundChatMessages = new WebSocket('ws://lsb2-chat.local.svc.cluster.local/app/chatMessage.new');
var outboundChatMessages = new WebSocket(webServiceUrl + '/app/chatMessage.new');
// Post new chat messages
outboundChatMessages.onopen = function(event) {
document.getElementById('chatButton')
Expand All @@ -163,7 +164,7 @@ <h1>Learning Spring Boot - 2nd Edition</h1>

<!-- tag::chat-3[] -->
var inboundChatMessages =
new WebSocket('ws://lsb2-chat.local.svc.cluster.local/topic/chatMessage.new');
new WebSocket(webServiceUrl + '/topic/chatMessage.new');
// Listen for new chat messages
inboundChatMessages.onmessage = function (event) {
console.log('Received ' + event.data);
Expand Down

0 comments on commit 3dfd0a4

Please sign in to comment.