This commit is contained in:
2025-12-16 03:42:18 +00:00
parent 9681143719
commit 52757b05f9
9 changed files with 159 additions and 38 deletions

View File

@@ -16,7 +16,7 @@ let len = 0;
async function fetchPosts() {
try {
const res = await axios.get("/api/posts");
const res = await axios.get("https://www.adam-french.co.uk/api/posts");
posts = res.data;
len = posts.length;
fetched.value = true;
@@ -68,8 +68,8 @@ onMounted(() => {
<template>
<div v-if="fetched" class="center-content">
<h2>{{ post.title }}</h2>
<p>By: {{ post.author.username }}</p>
<div>{{ post.content }}</div>
<p>by: {{ post.author.username }}</p>
<small
>Created at: {{ new Date(post.createdAt).toLocaleString() }}</small
>