Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanlee85 committed Aug 16, 2023
1 parent d7e3be5 commit ce16b35
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions examples/v7-edge-functions/functions/planetscale-database.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ export async function handleHttpRequest(request, context) {
// message: `Total number of records: ${totalCount}`,
// });

context.geo = JSON.parse(JSON.stringify(context.geo));
context.geo = JSON.parse(JSON.stringify(context.geo));

const response = new Response(context.geo.country, {
headers: {
'content-type': 'application/json; charset=utf-8',
},
});
const response = new Response(JSON.stringify(context.geo, null, 2), {
headers: {
'content-type': 'application/json; charset=utf-8',
},
});

response.headers.set('x-custom-header', context.geo.country || 'empty');

Expand Down

0 comments on commit ce16b35

Please sign in to comment.