mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-10 12:57:47 +00:00
[examples] Make -functions example the default (#3541)
* Remove now-examples references * Adjust gatsby example * Adjust svelte example * Adjust vanilla example
This commit is contained in:
@@ -1,11 +1,48 @@
|
||||
<script>
|
||||
export let name;
|
||||
import { onMount } from "svelte";
|
||||
export let date;
|
||||
|
||||
onMount(async () => {
|
||||
const res = await fetch("/api/date");
|
||||
const newDate = await res.text();
|
||||
date = newDate;
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
h1 {
|
||||
color: purple;
|
||||
}
|
||||
</style>
|
||||
|
||||
<h1>Hello {name}!</h1>
|
||||
<main>
|
||||
<h1>Svelte + Node.js 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/tree/master/svelte-functions"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener">
|
||||
This project
|
||||
</a>
|
||||
is a
|
||||
<a href="https://svelte.dev/">Svelte</a>
|
||||
app with three directories,
|
||||
<code>/public</code>
|
||||
for static assets,
|
||||
<code>/src</code>
|
||||
for components and content, and
|
||||
<code>/api</code>
|
||||
which contains a serverless
|
||||
<a href="https://nodejs.org/en/">Node.js</a>
|
||||
function. See
|
||||
<a href="/api/date">
|
||||
<code>api/date</code>
|
||||
for the Date API with Node.js
|
||||
</a>
|
||||
.
|
||||
</p>
|
||||
<br />
|
||||
<h2>The date according to Node.js is:</h2>
|
||||
<p>{date ? date : 'Loading date...'}</p>
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user