Skip to content

Commit 434c3c2

Browse files
authored
Merge pull request #232 from graphql/handle-redirets-other-routes
2 parents 4275409 + d5cf816 commit 434c3c2

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

handler/index.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
* 301 permanently redirect /index requests to /graphql
33
*/
44
export const handler = async function(event) {
5+
if (req.httpMethod === 'OPTIONS') {
6+
return { statusCode: 200 };
7+
}
58
let location = '/graphql';
69
if (event.queryStringParameters) {
710
location += '?' + new URLSearchParams(event.queryStringParameters);

handler/swapi.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
* 301 permanently redirect /swapi requests to /graphql
33
*/
44
export const handler = async function(event) {
5+
if (req.httpMethod === 'OPTIONS') {
6+
return { statusCode: 200 };
7+
}
58
let location = '/graphql';
69
if (event.queryStringParameters) {
710
location += '?' + new URLSearchParams(event.queryStringParameters);

0 commit comments

Comments
 (0)