mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Use request path for api path
This commit is contained in:
parent
41d5b5ec70
commit
b126ee12c0
1 changed files with 5 additions and 1 deletions
|
|
@ -36,7 +36,11 @@ const {
|
||||||
|
|
||||||
const apiUrl = new URL( import.meta.env.PUBLIC_API_DOMAIN )
|
const apiUrl = new URL( import.meta.env.PUBLIC_API_DOMAIN )
|
||||||
|
|
||||||
apiUrl.pathname = `/api/${ Astro.site.pathname }.json`
|
// Parse the request url
|
||||||
|
const requestUrl = new URL( Astro.request.url )
|
||||||
|
|
||||||
|
// Use request path to get api url path
|
||||||
|
apiUrl.pathname = `/api${ requestUrl.pathname }.json`
|
||||||
|
|
||||||
|
|
||||||
// Astro Request reference
|
// Astro Request reference
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue