Skip to content

Commit

Permalink
chore: Move map and GitHub stats endpoints into API subpath
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Jan 19, 2025
1 parent c694e7a commit 03066eb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
26 changes: 13 additions & 13 deletions frontend/src/components/FooterMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,49 +5,49 @@ import { ApiPath } from "@/config/api.js";
<template>
<picture class="w-full">
<source
:srcset="ApiPath('/map/xxl-dark.png')"
:srcset="ApiPath('/api/map/xxl-dark.png')"
media="(min-width: 2000px) and (prefers-color-scheme: dark)"
/>
<source
:srcset="ApiPath('/map/xl-dark.png')"
:srcset="ApiPath('/api/map/xl-dark.png')"
media="(min-width: 1400px) and (prefers-color-scheme: dark)"
/>
<source
:srcset="ApiPath('/map/lg-dark.png')"
:srcset="ApiPath('/api/map/lg-dark.png')"
media="(min-width: 992px) and (prefers-color-scheme: dark)"
/>
<source
:srcset="ApiPath('/map/md-dark.png')"
:srcset="ApiPath('/api/map/md-dark.png')"
media="(min-width: 768px) and (prefers-color-scheme: dark)"
/>
<source
:srcset="ApiPath('/map/sm-dark.png')"
:srcset="ApiPath('/api/map/sm-dark.png')"
media="(min-width: 576px) and (prefers-color-scheme: dark)"
/>
<source
:srcset="ApiPath('/map/xxl-light.png')"
:srcset="ApiPath('/api/map/xxl-light.png')"
media="(min-width: 2000px) and (prefers-color-scheme: light)"
/>
<source
:srcset="ApiPath('/map/xl-light.png')"
:srcset="ApiPath('/api/map/xl-light.png')"
media="(min-width: 1400px) and (prefers-color-scheme: light)"
/>
<source
:srcset="ApiPath('/map/lg-light.png')"
:srcset="ApiPath('/api/map/lg-light.png')"
media="(min-width: 992px) and (prefers-color-scheme: light)"
/>
<source
:srcset="ApiPath('/map/md-light.png')"
:srcset="ApiPath('/api/map/md-light.png')"
media="(min-width: 768px) and (prefers-color-scheme: light)"
/>
<source
:srcset="ApiPath('/map/sm-light.png')"
:srcset="ApiPath('/api/map/sm-light.png')"
media="(min-width: 576px) and (prefers-color-scheme: light)"
/>
<source :srcset="ApiPath('/map/xs-light.png')" media="(prefers-color-scheme: light)" />
<source :srcset="ApiPath('/map/xs-dark.png')" />
<source :srcset="ApiPath('/api/map/xs-light.png')" media="(prefers-color-scheme: light)" />
<source :srcset="ApiPath('/api/map/xs-dark.png')" />
<img
:src="ApiPath(`/map/lg-dark.png`)"
:src="ApiPath(`/api/map/lg-dark.png`)"
alt="Map of Oklahoma City"
class="w-full h-[200px] lg:h-[300px] object-cover"
/>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/ConnectView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<h2 class="font-medium text-2xl">Accounts</h2>
<ul class="flex flex-row gap-3 list-none justify-center">
<li>
<a :href="ApiPath('/to/github')" class="btn btn-primary" target="_blank">
<a :href="ApiPath('/api/to/github')" class="btn btn-primary" target="_blank">
<github-icon />
Github
</a>
</li>
<li>
<a :href="ApiPath('/to/linkedin')" class="btn btn-primary" target="_blank">
<a :href="ApiPath('/api/to/linkedin')" class="btn btn-primary" target="_blank">
<linkedin-icon />
LinkedIn
</a>
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func main() {
})

e.Router.GET("/{path...}", handlers.Static(conf))
e.Router.GET("/to/{handle}", handlers.Redirect())
e.Router.GET("/api/to/{handle}", handlers.Redirect())

if err := githubstats.RegisterRoutes(ctx, conf, e); err != nil {
return err
Expand All @@ -63,7 +63,7 @@ func main() {
return err
}

e.Router.GET("/map/{path...}", mapClient.Handler())
e.Router.GET("/api/map/{path...}", mapClient.Handler())
}

return e.Next()
Expand Down

0 comments on commit 03066eb

Please sign in to comment.