Skip to content

Commit 192cdb4

Browse files
committed
First example
1 parent ee9ca05 commit 192cdb4

File tree

4 files changed

+47
-0
lines changed

4 files changed

+47
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# ZEIT Now Examples by Juicy(fx)
2+
3+
| Example | Description | Demo | Deploy |
4+
|-------------|-------------|------|--------|
5+
| [PHP](/php) | Static frontend with PHP function. | [👀🕶](https://now-examples-php.now.sh) | [▲▲▲](https://zeit.co/new/project?template=https://github.com/juicyfx/now-examples/tree/master/php) |

php/api/index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
3+
header('conten-type: application/json');
4+
echo json_encode(['time' => time(), 'date' => date('d.m.Y'), 'tech' => 'ZEIT Now']);

php/index.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
<title>ZEIT Now + PHP</title>
8+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/1.1.4/tailwind.min.css" />
9+
</head>
10+
<body class="font-mono bg-gray-300 w-screen h-screen flex items-center justify-center">
11+
<div>
12+
<div class="text-5xl font-bold">
13+
ZEIT Now + PHP
14+
<a class="inline-block" href="https://zeit.co/new/project?template=https://github.com/juicyfx/now-examples/tree/master/php">
15+
<img src="https://zeit.co/button" alt="Deploy to ZEIT Now" />
16+
</a>
17+
</div>
18+
19+
<p class="text-xl my-10">Use the <strong>deploy</strong> button or follow these steps.</p>
20+
21+
22+
<ol class="list-decimal my-4 mx-8 text-normal">
23+
<li class="py-2">Clone repository <code class="bg-pink-600 rounded rounded-sm text-white p-2">git clone [email protected]:juicyfx/now-examples.git</code></li>
24+
<li class="py-2">Switch to <code>/php</code> folder and run <code class="underline font-bold">now</code></li>
25+
<li class="py-2">Open generated <strong>*.now.sh</strong> domain [<a class="text-pink-800" href="https://now-examples-php.now.sh">demo</a>]</li>
26+
<li class="py-2">Discover <strong>*.now.sh/api/</strong> PHP functions [<a class="text-pink-800" href="https://now-examples-php.now.sh/api/">demo</a>] </li>
27+
</ol>
28+
</div>
29+
</body>
30+
</html>

php/now.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"regions": ["all"],
3+
"functions": {
4+
"api/index.php": {
5+
"runtime": "[email protected]"
6+
}
7+
}
8+
}

0 commit comments

Comments
 (0)