-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(routes): support expressions routes (#217)
- Loading branch information
1 parent
5aa75c7
commit 69c42fc
Showing
11 changed files
with
357 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { handleRequestError } from '@pw/helpers/misc' | ||
import type { AxiosError, AxiosRequestConfig, Method } from 'axios' | ||
import axios from 'axios' | ||
|
||
export const fetchKongResource = async (endpoint: string) => { | ||
const kongUrl = process.env.KM_TEST_API_URL | ||
const options: AxiosRequestConfig = { | ||
method: 'GET' as Method, | ||
url: `${kongUrl}${endpoint}`, | ||
headers: { | ||
'Content-Type': 'application/json', | ||
'Connection': 'close', | ||
}, | ||
} | ||
|
||
try { | ||
return await axios(options) | ||
} catch (err) { | ||
handleRequestError('fetchKongResource', err as AxiosError<object>) | ||
} | ||
} |
This file contains 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
Oops, something went wrong.