added static php-crud-api
This commit is contained in:
@@ -7,7 +7,7 @@ var clientId = ''; // client id as defined in auth0
|
||||
var audience = 'https://your-php-crud-api/api.php'; // api audience as defined in auth0
|
||||
var url = '/api.php/records/posts?join=categories&join=tags&join=comments&filter=id,eq,1';
|
||||
|
||||
function requestAPI() {
|
||||
function requestApi() {
|
||||
var match = RegExp('[#&]access_token=([^&]*)').exec(window.location.hash);
|
||||
var accessToken = match && decodeURIComponent(match[1].replace(/\+/g, ' '));
|
||||
if (!accessToken) {
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css"/>
|
||||
<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#example').DataTable( {
|
||||
ajax: {
|
||||
url: '/api.php/records/posts?join=categories&join=users',
|
||||
dataSrc: 'records'
|
||||
},
|
||||
columns: [
|
||||
{ data: "id" },
|
||||
{ data: "user_id.username" },
|
||||
{ data: "category_id.name" },
|
||||
{ data: "content" }
|
||||
]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<table id="example" class="display" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Username</th>
|
||||
<th>Category</th>
|
||||
<th>Content</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Username</th>
|
||||
<th>Category</th>
|
||||
<th>Content</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user