-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
_ci: adds src/http/get-api-sickpicks/index.js
- Loading branch information
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Enable secure sessions, express-style middleware, and more: | ||
// https://docs.begin.com/en/functions/http/ | ||
// | ||
// let begin = require('@architect/functions') | ||
|
||
let html = ` | ||
<!doctype html> | ||
<html lang=en> | ||
<head> | ||
<meta charset=utf-8> | ||
<title>Hi!</title> | ||
<link rel="stylesheet" href="https://static.begin.app/starter/default.css"> | ||
<link href="data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=" rel="icon" type="image/x-icon" /> | ||
</head> | ||
<body> | ||
<h1 class="center-text"> | ||
Hello world! | ||
</h1> | ||
<p class="center-text"> | ||
Your new route is ready to go! | ||
</p> | ||
<p class="center-text"> | ||
Learn more about building <a href="https://docs.begin.com/en/functions/http/" class="link" target="_blank">Begin HTTP functions here</a>. | ||
</p> | ||
</body> | ||
</html> | ||
` | ||
|
||
// HTTP function | ||
exports.handler = async function http(req) { | ||
console.log(req) | ||
return { | ||
headers: { | ||
'content-type': 'text/html; charset=utf8', | ||
'cache-control': 'no-cache, no-store, must-revalidate, max-age=0, s-maxage=0' | ||
}, | ||
body: html | ||
} | ||
} |