-
-
Save Chojiu15/6e41a976c092955c46823d288cb234ca to your computer and use it in GitHub Desktop.
client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {useState, useEffect} from "react"; | |
import "./App.css"; | |
import {client} from './client' | |
import axios from 'axios' | |
const App = () => { | |
const [articles, setArticles] = useState([]) | |
useEffect(() => { | |
client.getEntries({ | |
content_type : 'weeklyProject' | |
}) | |
.then(response => console.log(response.items)) | |
}) | |
return ( | |
<div className="App"> | |
</div> | |
); | |
}; | |
export default App; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as contentful from 'contentful' | |
require('dotenv').config() | |
export const client = contentful.createClient({ | |
space : process.env.SPACE_KEY, | |
accessToken : process.env.ACCESS_TOKEN | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment