File size: 793 Bytes
cf07b75
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { d as private_env } from './shared-server-49TKSBDM.js';
import { c as redirect, b as base } from './index-JNnR1J8_.js';
import { F as FullTextSearchService } from './FullTextSearchService-12fm-h8u.js';

const POST = async ({ locals, request }) => {
  const body = await request.json();
  console.log(private_env.SEARCH_API_URL);
  const abortController = new AbortController();
  let service = new FullTextSearchService(private_env.SEARCH_API_URL);
  let results = await service.search(body.query, { abortController });
  return new Response(
    JSON.stringify({ results }),
    {
      headers: { "Content-Type": "application/json" }
    }
  );
};
const GET = async () => {
  throw redirect(302, `${base}/`);
};

export { GET, POST };
//# sourceMappingURL=_server.ts-2j04j7k5.js.map