Express_Crud_Example/views/index.ejs

40 lines
1.1 KiB
Plaintext
Raw Normal View History

2022-01-28 22:33:42 +01:00
<!DOCTYPE html>
<html lang="en">
<head>
2022-01-28 22:53:32 +01:00
<link href="/css/style.css" rel="stylesheet" type="text/css">
2022-01-28 22:33:42 +01:00
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MY APP</title>
</head>
<body>
<h1>Express Node App</h1>
<form action="/quotes" method="post">
<input type="text" placeholder="name" name="name">
<input type="text" placeholder="quotes" name="quotes">
<button type="submit">Submit</button>
</form>
<h2>Quotes</h2>
<ul class="quotes">
<!-- Loop through quotes -->
<% for(var i=0; i < quotes.length; i++) {%>
<li class="quote">
<!-- Output name from the iterated quote object -->
<span>
<%= quotes[i].name %>
</span>:
<!-- Output quote from the iterated quote object -->
<span>
<%= quotes[i].quotes %>
</span>
</li>
<% } %>
</ul>
</body>
</html>