Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

$.ts

18 lines510 Bytes

1import { createFileRoute } from '@tanstack/react-router'
2import { StartAuthJS } from 'start-authjs'
3import { authConfig } from '~/utils/auth'
4​
5/**
6 * Auth.js API route handler
7 * Handles all auth routes: /api/auth/*
8 */
9const { GET, POST } = StartAuthJS(authConfig)
10​
11export const Route = createFileRoute('/api/auth/$')({
12 server: {
13 handlers: {
14 GET: ({ request }) => GET({ request, response: new Response() }),
15 POST: ({ request }) => POST({ request, response: new Response() }),
16 },
17 },
18})