Updated config and OPTIONS method for function.
This commit is contained in:
parent
39485dc6e1
commit
83a36d412e
@ -1,13 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"moduleResolution": "Node",
|
||||
"lib": [
|
||||
"esnext"
|
||||
],
|
||||
"types": [
|
||||
"@cloudflare/workers-types"
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -124,14 +124,14 @@ async function authorizeUser(params: Params) {
|
||||
});
|
||||
}
|
||||
|
||||
export default async (req: Request, context: Context) => {
|
||||
export default async (req: Request, context: Context): Promise<Response> => {
|
||||
console.log(req.method);
|
||||
|
||||
if (req.method == 'OPTIONS') {
|
||||
const origin = req.headers.get('Origin');
|
||||
console.log(origin);
|
||||
return new Response(
|
||||
new Blob(),
|
||||
'OK',
|
||||
{
|
||||
headers: {
|
||||
'Allow': 'POST',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user