File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export default function BlogPage() {
1010 useEffect ( ( ) => {
1111 fetch ( `${ import . meta. env . PUBLIC_API_URL } /api/gist/${ slug } /` ) . then ( async r => {
1212 setContent ( insane (
13- await marked . parse ( ( await r . json ( ) ) [ "files" ] [ "content.md" ] [ " content"] || "Not found" ) ,
13+ await marked . parse ( ( await r . json ( ) ) [ "content" ] || "Not found" ) ,
1414 ) ) ;
1515 } ) . catch ( ( err ) => {
1616 console . error ( err )
Original file line number Diff line number Diff line change 11import { useEffect , useState } from "react" ;
22
33export default function Blog ( ) {
4- const URL = "https://api.github.com/users/etherbeing/gists?per_page=15" ;
54 const [ posts , setPosts ] = useState <
65 Array < {
76 id : string ;
@@ -14,7 +13,7 @@ export default function Blog() {
1413 "justify-start" | "justify-center"
1514 > ( "justify-start" ) ;
1615 useEffect ( ( ) => {
17- fetch ( URL ) . then ( async ( response ) => {
16+ fetch ( ` ${ import . meta . env . PUBLIC_API_URL } /api/gists/` ) . then ( async ( response ) => {
1817 if ( response . ok ) {
1918 setPosts ( await response . json ( ) ) ;
2019 if ( posts . length % 3 === 1 ) {
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ interface Repo {
1212export default function Projects ( ) {
1313 const [ repos , setRepos ] = useState < Array < Repo > > ( [ ] ) ;
1414 useEffect ( ( ) => {
15- fetch ( "https://api.github.com/users/etherbeing/repos?per_page=5" ) . then (
15+ fetch ( ` ${ import . meta . env . PUBLIC_API_URL } /api/projects/` ) . then (
1616 async ( res ) => {
1717 if ( res . ok ) setRepos ( await res . json ( ) )
1818 } ,
You can’t perform that action at this time.
0 commit comments