mirror of
https://github.com/allankoechke/tutorials.git
synced 2026-11-30 17:27:11 +00:00
24 lines
440 B
PHP
24 lines
440 B
PHP
<html>
|
|
<head>
|
|
<title>My Shop</title>
|
|
</head>
|
|
|
|
<body>
|
|
<h1>Welcome to my shop</h1>
|
|
<ul>
|
|
<?php
|
|
|
|
$json = file_get_contents('http://product-service/');
|
|
$obj = json_decode($json);
|
|
|
|
$products = $obj->products;
|
|
|
|
foreach ($products as $product) {
|
|
echo "<li>$product</li>";
|
|
}
|
|
|
|
?>
|
|
</ul>
|
|
</body>
|
|
</html>
|