feat: support cors

This commit is contained in:
GitPusher99
2024-04-05 00:22:44 +08:00
parent 6ac19b5120
commit 6a9de6d059
7 changed files with 146 additions and 37 deletions
+7
View File
@@ -18,4 +18,11 @@ export const sleep = (x: number, y?: number): Promise<void> => {
logger.info(`Sleeping for ${timeout / 1000} seconds`);
return new Promise(resolve => setTimeout(resolve, timeout));
}
export const corsHeaders = {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
'Access-Control-Allow-Headers': 'Content-Type, Authorization',
}