Create axios instance readAxiosInstance
This commit is contained in:
@@ -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`)
|
||||
|
||||
Reference in New Issue
Block a user