Simple Chat Room in NodeJS, expressJS and mongoDB in Docker Swarm
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

31 lines
813 B

<!-- index.ejs -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Node Js Web App</title>
</head>
<body>
<h1>Cloud Computing chat room</h1>
<form action="/quotes" method="POST">
<input type="text" placeholder="name" name="name" />
<input type="text" placeholder="messages" name="messages" />
<button type="submit">Submit</button>
</form>
<h2> Messages </h2>
<ul class="messages">
<!-- Loop through messages -->
<% for(var i = 0; i < messages.length; i++) {%>
< class="message">
<!-- Output name from the iterated message object -->
<span><%= messages[i].name %></span>:
<!-- Output quote from the iterated quote object -->
<span><%= messages[i].message %></span>
</li>
<% } %>
</ul>
</body>
</html>