Files
vercel/examples/vanilla-functions/index.html
Andy 890de6a625 Add API for frameworks and examples (#3514)
* Add API for frameworks and examples

* Adjust headers

* Update frameworks list

* Always use latest

* Add types

* Use now repo for downloading and listing

* Use .existsSync

* Remove unused packages

* Use 307 for redirect

* Add examples

* Update tsconfig.json

Co-Authored-By: Steven <steven@ceriously.com>

* Make examples unique

* Remove detectors from frameworks API

* Use /api instead of Next.js

* Install dependencies

* Rename project

* Change name

* Empty

* Change name

* Update api/tsconfig.json

Co-Authored-By: Steven <steven@ceriously.com>

* Update examples

Co-authored-by: Steven <steven@ceriously.com>
2020-01-07 23:55:39 +01:00

47 lines
1.3 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>Vanilla + Go API</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<h1>Welcome to a Static Site with Data from a Go API</h1>
<h2>
Deployed with
<a href="https://zeit.co/docs" target="_blank" rel="noreferrer noopener"
>ZEIT Now</a
>!
</h2>
<p>
<a
href="https://github.com/zeit/now-examples/blob/master/vanilla-functions"
target="_blank"
rel="noreferrer noopener"
>This project</a
>
includes three files. A static <code>index.html</code> file as the
homepage, a static <code>style.css</code> file for styling, and a
<code>api/date.go</code> serverless function that returns the date on
invocation. See
<a href="/api/date.go"
><code>api/date.go</code> for the Date API with Go</a
>.
</p>
<br />
<h3>The date according to Go is:</h3>
<p class="date">Loading date...</p>
<script>
function main() {
return fetch('/api/date.go')
.then(function(response) {
return response.text();
})
.then(function(date) {
document.querySelector('.date').textContent = date;
});
}
main();
</script>
</body>
</html>