mirror of
https://github.com/BradNut/awesome-uses
synced 2025-09-08 17:40:31 +00:00
_ci: adds src/http/get-index/index.js
This commit is contained in:
parent
c6284321af
commit
9c0bad1f8c
1 changed files with 39 additions and 0 deletions
39
src/http/get-index/index.js
Normal file
39
src/http/get-index/index.js
Normal file
|
|
@ -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
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue