feat: crud and backups are working
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
export function BlogList() {
|
||||
fetch("public/blogs/*.md").then((ret) => console.log(ret.text()));
|
||||
import { useState, useEffect } from "react";
|
||||
|
||||
return <div></div>;
|
||||
export function BlogList() {
|
||||
const [content, setContent] = useState("");
|
||||
useEffect(() => {
|
||||
fetch(`localhost:8000/get-blogs`)
|
||||
.then((res) => res.text())
|
||||
.then(setContent);
|
||||
}, []);
|
||||
|
||||
return <div>{content}</div>;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ export function BlogViewer() {
|
||||
const { slug } = useParams();
|
||||
|
||||
useEffect(() => {
|
||||
fetch(`/blogs/${slug ?? "home"}.md`)
|
||||
fetch(`localhost:8000/get-blogs/${slug}`)
|
||||
.then((res) => res.text())
|
||||
.then(setContent);
|
||||
}, []);
|
||||
|
||||
Reference in New Issue
Block a user