This commit is contained in:
liyasthomas
2021-09-10 12:15:08 +05:30
parent 80c7decb81
commit f1b18688bb
3 changed files with 6 additions and 22 deletions

3
.gitignore vendored
View File

@@ -104,3 +104,6 @@ tests/*/screenshots
# Tests videos # Tests videos
tests/*/videos tests/*/videos
# Local Netlify folder
.netlify

View File

@@ -1,5 +1,7 @@
[build] [build]
functions = "netlify/" base = "packages/hoppscotch-app/"
publish = "dist"
command = "npm run generate"
environment = { NODE_VERSION = "14" } environment = { NODE_VERSION = "14" }
[[redirects]] [[redirects]]

View File

@@ -1,21 +0,0 @@
// Docs on event and context https://www.netlify.com/docs/functions/#the-handler-method
exports.handler = (event) => {
switch (event.httpMethod) {
case "GET":
try {
const name = event.queryStringParameters.name || "World"
return {
statusCode: 200,
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ message: `Hello ${name}` }),
}
} catch (e) {
return { statusCode: 500, body: e.toString() }
}
default:
return { statusCode: 405, body: "Method Not Allowed" }
}
}