Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #20

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions javawebapp-deployment.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
---
apiVersion: v1
kind: ReplicationController
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
name: javawebapp
name: java-controller
spec:
replicas: 1
selector:
matchLabels:
app: javawebapp
template:
metadata:
labels:
name: javawebapp
app: javawebapp
spec:
containers:
- image: dockerhandson/java-web-app
- image: 007892345/testapp:BUILD_NUMBER
name: javawebapp
imagePullPolicy: IfNotPresent
ports:
- name: javawebapp
containerPort: 8080
Expand All @@ -23,10 +27,10 @@ spec:
apiVersion: v1
kind: Service
metadata:
labels:
name: javawebapp
name: javawebapp
spec:
selector:
app: javawebapp
type: NodePort
ports:
- port: 8080
Expand Down
2 changes: 1 addition & 1 deletion springBootMongo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
app: springboot
spec:
containers:
- image: dockerhandson/spring-boot-mongo
- image: 007892345/testapp:BUILD_NUMBER
name: springboot
ports:
- containerPort: 8080
Expand Down
58 changes: 3 additions & 55 deletions src/main/resources/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
<script type="text/javascript"
th:src="@{/webjars/bootstrap/3.3.7/js/bootstrap.min.js}"></script>

<title>Spring Boot MongoDB Demo</title>
<title>SpringBoot MongoDBDemo</title>
</head>
<body>
<div class="container">
<h1 class="text-center">Spring Boot + MongoDB Demo</h1>
<h1 class="text-center">SpringBoot</h1>
<div class="col-md-6">
<form name="saveUser" action="/save" method="post"
class="form-horizontal">
Expand All @@ -47,58 +47,6 @@ <h1 class="text-center">Spring Boot + MongoDB Demo</h1>
</div>


<div class="col-md-12">
<h2>Saved Users</h2>
<table id="usersTable" class="table table-striped">
<thead>
<tr>
<th>ID</th>
<th>First Name</th>
<th>Last Name</th>
<th>Email</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>


<div class="row-md-8">
<div class="col-md-3">
<img th:src="@{/img/mithunlogo.jpg}" alt="logo" height="200">
</div>
<div class="col-md-8">
<h4 class="text-center">Mithun Technologies - Consultant,
Training, Development Center.</h4>
<h4 class="text-center">Contact @ +91-8296242028 ,
+91-9980923226</h4>
<h5 class="text-center">
Copyrights 2020 by <a href="http://mithuntechnologies.com/">Mithun
Technologies</a>
</h5>
</div>
</div>

</div>

<script>
$.ajax({
url : "/api/users",

success : function(response) {
$.each(response, function(i, item) {
var row = $("<tr />");
$("#usersTable").append(row);

row.append($("<td>" + item.id + "</td>"));
row.append($("<td>" + item.firstName + "</td>"));
row.append($("<td>" + item.lastName + "</td>"));
row.append($("<td>" + item.email + "</td>"));

});
}
})
</script>

</body>
</html>