16 lines
405 B
JavaScript

import { flushCache } from '../utils/notion.js';
export async function handleFlushCacheRequest(request) {
await flushCache();
const response = {
result: 'ok',
};
return new Response(JSON.stringify(response), {
headers: {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*', // Enable CORS
'Cache-Control': 'public, max-age=600', // 10 minute browser cache
},
});
}