add netlify function

main
koehr 2 years ago
parent db2c9bcd36
commit bb8accf537

@ -0,0 +1,17 @@
// Docs on event and context https://www.netlify.com/docs/functions/#the-handler-method
const handler = async (event) => {
try {
const subject = event.queryStringParameters.name || 'World'
return {
statusCode: 200,
body: JSON.stringify({ message: `Hello ${subject}` }),
// // more keys you can return:
// headers: { "headerName": "headerValue", ... },
// isBase64Encoded: true,
}
} catch (error) {
return { statusCode: 500, body: error.toString() }
}
}
module.exports = { handler }

@ -0,0 +1,3 @@
[build]
publish = "dist"
functions = "functions"
Loading…
Cancel
Save