-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
35 lines (34 loc) · 951 Bytes
/
index.php
File metadata and controls
35 lines (34 loc) · 951 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<title>Docker - QSFC7</title>
</head>
<body>
<?php
$result = file_get_contents('http://node-container:9001/products');
$products = json_decode($result);
?>
<h1>Produtos</h1>
<div class="container">
<table class="table">
<thead>
<tr>
<th>Nome</th>
<th>Preço</th>
</tr>
</thead>
<tbody>
<?php foreach ($products as $product): ?>
<tr>
<td><?php echo $product->name ?></td>
<td><?php echo $product->price ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</body>
</html>