Skip to content

Commit

Permalink
Add JSON headers to Function generator template (redwoodjs#2457)
Browse files Browse the repository at this point in the history
* Adding JSON headers

See @dthyresson suggestion: https://github.com/redwoodjs/redwoodjs.com/pull/682#issuecomment-832704119

* updated 4 snapshots to expect JSON Content-Type

Co-authored-by: David Thyresson <dthyresson@gmail.com>
  • Loading branch information
2 people authored and fveauvy committed May 15, 2021
1 parent dc6aa83 commit a25e96a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ export const handler = async (event, context) => {
return {
statusCode: 200,
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
data: 'javascriptFunction function',
}),
Expand Down Expand Up @@ -57,6 +61,9 @@ export const handler = async (event: APIGatewayEvent, context: Context) => {
return {
statusCode: 200,
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
data: 'typescriptFunction function',
}),
Expand Down Expand Up @@ -89,6 +96,10 @@ export const handler = async (event, context) => {
return {
statusCode: 200,
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
data: 'sendMail function',
}),
Expand Down Expand Up @@ -121,6 +132,10 @@ export const handler = async (event, context) => {
return {
statusCode: 200,
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
data: 'foo function',
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export const handler = async (event: APIGatewayEvent, context: Context) => {

return {
statusCode: 200,
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
data: '${name} function',
}),
Expand Down

0 comments on commit a25e96a

Please sign in to comment.