Create axios instance readAxiosInstance

This commit is contained in:
Cédric FAMIBELLE-PRONZOLA
2022-05-17 08:59:36 +04:00
parent c42ada66fa
commit d8b7fd130d
+7
View File
@@ -2,6 +2,13 @@ import axios from 'axios'
const OKI_API = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:1337'
const AWTIS_POU_CHAK_PAJ = process.env.NEXT_PUBLIC_AWTIS_POU_CHAK_PAJ || 6
const readToken = process.env.NEXT_PUBLIC_READ_TOKEN || 'read-token'
const readAxiosInstance = axios.create({
headers: {
Authorization: `Bearer ${readToken}`
}
})
export async function jwennTeksEpiSlug(slug) {
const response = await axios.get(`${OKI_API}/teks?slug=${slug}&_where[published_at_null]=false`)