types import error fixed
This commit is contained in:
1 parent
c6e602d354
commit
cb2355adcd
8 files changed
+39
-8
No files matched your search
@@ -0,0 +1,30 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test Article API</title>
|
||||
<script>
|
||||
async function testAPI() {
|
||||
try {
|
||||
const response = await fetch('http://localhost:3000/api/v1/articles?status=published');
|
||||
const data = await response.json();
|
||||
document.getElementById('result').innerHTML = `
|
||||
<h2>API Test Result</h2>
|
||||
<p>Status: ${response.status}</p>
|
||||
<p>Articles found: ${data.total}</p>
|
||||
<pre>${JSON.stringify(data.data[0], null, 2)}</pre>
|
||||
`;
|
||||
} catch (error) {
|
||||
document.getElementById('result').innerHTML = `
|
||||
<h2>Error</h2>
|
||||
<p>${error.message}</p>
|
||||
`;
|
||||
}
|
||||
}
|
||||
window.onload = testAPI;
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Testing Article API</h1>
|
||||
<div id="result">Loading...</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user