- Added api-reference.json for API specifications including authentication, response formats, and available endpoints. - Created index.html for public API documentation, dynamically loading endpoint details from api-reference.json. - Removed htaccess.conf file and migrated routing logic to pp_routes for improved maintainability. - Added new 'type' column in pp_routes to differentiate between entity and system routes.
61 lines
1.9 KiB
HTML
61 lines
1.9 KiB
HTML
<!doctype html>
|
|
<html lang="pl">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>shopPRO API docs</title>
|
|
<style>
|
|
:root { color-scheme: light; }
|
|
body { font-family: Arial, sans-serif; margin: 24px; line-height: 1.4; }
|
|
h1, h2 { margin-bottom: 8px; }
|
|
.meta { color: #444; margin-bottom: 16px; }
|
|
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
|
|
th, td { border: 1px solid #ddd; padding: 8px; text-align: left; vertical-align: top; }
|
|
th { background: #f4f4f4; }
|
|
code { background: #f7f7f7; padding: 2px 4px; border-radius: 3px; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>shopPRO API - public docs</h1>
|
|
<div class="meta" id="meta">Ladowanie...</div>
|
|
<p>Machine-readable JSON: <a href="./api-reference.json">api-reference.json</a></p>
|
|
|
|
<h2>Endpointy</h2>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Group</th>
|
|
<th>Action</th>
|
|
<th>Method</th>
|
|
<th>URL template</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="rows"></tbody>
|
|
</table>
|
|
|
|
<script>
|
|
fetch("./api-reference.json")
|
|
.then(function (res) { return res.json(); })
|
|
.then(function (spec) {
|
|
var meta = document.getElementById("meta");
|
|
meta.textContent = spec.name + " v" + spec.version + " | entrypoint: " + spec.entrypoint;
|
|
|
|
var rows = document.getElementById("rows");
|
|
spec.endpoints.forEach(function (ep) {
|
|
var tr = document.createElement("tr");
|
|
tr.innerHTML =
|
|
"<td>" + ep.group + "</td>" +
|
|
"<td>" + ep.action + "</td>" +
|
|
"<td><code>" + ep.method + "</code></td>" +
|
|
"<td><code>" + ep.url_template + "</code></td>";
|
|
rows.appendChild(tr);
|
|
});
|
|
})
|
|
.catch(function () {
|
|
var meta = document.getElementById("meta");
|
|
meta.textContent = "Nie udalo sie wczytac api-reference.json";
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|