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);
|
console.log(req.method);
|
||||||
|
|
||||||
if (req.method == 'OPTIONS') {
|
if (req.method == 'OPTIONS') {
|
||||||
const origin = req.headers.get('Origin');
|
const origin = req.headers.get('Origin');
|
||||||
console.log(origin);
|
console.log(origin);
|
||||||
return new Response(
|
return new Response(
|
||||||
new Blob(),
|
'OK',
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
'Allow': 'POST',
|
'Allow': 'POST',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user