Skip to content

Commit

Permalink
Add cors headers to the app config route
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeGinnivan committed Oct 22, 2024
1 parent 7931d30 commit 21e412a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions website/app/routes/app-config.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
import { LoaderFunctionArgs } from '@remix-run/server-runtime'
import { json, LoaderFunctionArgs } from '@remix-run/server-runtime'
import { YearSponsors } from '~/lib/config-types'

/** This route is used by the app or integrations to understand the state of the conference */
export function loader({ context }: LoaderFunctionArgs): AppConfig {
return {
export function loader({ context }: LoaderFunctionArgs) {
const data: AppConfig = {
conferenceDate: context.conferenceState.conference.date ?? null,
sponsors: context.conferenceState.conference.sponsors,
support: 'https://raw.githubusercontent.com/dddwa/dddperth/refs/heads/main/website-content/pages/support.mdx',
home: {
after: 'https://raw.githubusercontent.com/dddwa/dddperth/refs/heads/main/website-content/pages/post-conference.mdx',
},
}

return json(data, {
headers: {
'Access-Control-Allow-Origin': '*',
},
})
}

interface AppConfig {
Expand Down

0 comments on commit 21e412a

Please sign in to comment.