-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add overlay
category to integrations
#878
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
66d6026
feat(api): add specific integrations/overlay endpoint
natemoo-re 9d0f194
ci: apply formatting changes
natemoo-re bd3f95c
fix: move from [...page] to [page]
natemoo-re bea634a
wip: try trailingSlash always
natemoo-re a168acf
ci: apply formatting changes
natemoo-re 866d67a
move to subdirectories
natemoo-re 6b33eff
move endpoints
natemoo-re a36b0f5
rename subpaths
natemoo-re 533dcd3
updating integrations frontmatter and fixing a bug in update-integrat…
eca6dc5
ci: apply formatting changes
tony-sull b0d9b2f
Update integrations.json
FredKSchott ef6dadb
ci: apply formatting changes
FredKSchott 0d0a135
fix: remove comment
natemoo-re 8b3e36e
chore: update overlay integrations
natemoo-re a09eb42
Discard changes to src/content/integrations/@astrojspartytown.md
natemoo-re File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"integrations": "Tue, 14 Nov 2023 00:00:00 GMT" | ||
"integrations": "Fri, 17 Nov 2023 17:32:02 GMT" | ||
} |
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,45 @@ | ||
import type { APIRoute } from "astro" | ||
import { integrations as LAST_MODIFIED } from "~/data/last-modified.json" | ||
import { getFilteredIntegrations } from "~/helpers/integrations.ts" | ||
|
||
export const prerender = false | ||
|
||
const headers = { | ||
accept: "application/json", | ||
"cache-control": "public,max-age=604800,s-max-age=604800,stale-while-revalidate=86400", | ||
"last-modified": LAST_MODIFIED, | ||
"Access-Control-Allow-Credentials": "true", | ||
"Access-Control-Allow-Origin": "*", | ||
"Access-Control-Allow-Methods": "GET,OPTIONS,HEAD", | ||
"Access-Control-Allow-Headers": | ||
"X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, If-Modified-Since, X-Api-Version", | ||
} | ||
|
||
export const HEAD: APIRoute = (ctx) => { | ||
const modified = ctx.request.headers.get("If-Modified-Since") | ||
if (modified === LAST_MODIFIED) { | ||
return new Response(null, { status: 304 }) | ||
} | ||
return Response.json(null, { headers }) | ||
} | ||
|
||
export const GET: APIRoute = async (ctx) => { | ||
const modified = ctx.request.headers.get("If-Modified-Since") | ||
if (modified === LAST_MODIFIED) { | ||
return new Response(null, { status: 304 }) | ||
} | ||
const filteredIntegrations = await getFilteredIntegrations({ overlay: true }) | ||
|
||
const responseData = { | ||
data: filteredIntegrations.map(({ data }) => { | ||
if (data.image) data.image = new URL(data.image, ctx.url).toString() | ||
return data | ||
}), | ||
} | ||
|
||
return Response.json(responseData, { headers }) | ||
} | ||
|
||
export const ALL: APIRoute = ({ request }) => { | ||
return Response.json({ error: `${request.method} not allowed` }, { status: 405 }) | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be removed as soon as Spotlight is available
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this Spotlight magic you speak of?