File size: 375 Bytes
3ebd805
c8d90f4
 
1b66f8d
c8d90f4
 
 
 
3ebd805
c8d90f4
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { HF_TOKEN } from '$env/static/private';
import { PUBLIC_MODEL_ENDPOINT } from '$env/static/public';

export async function POST({ request, fetch }) {
	return await fetch(PUBLIC_MODEL_ENDPOINT, {
		headers: {
			...request.headers,
			'Content-Type': 'application/json',
			Authorization: `Basic ${HF_TOKEN}`
		},
		method: 'POST',
		body: await request.text()
	});
}