Interactive Serverless Playground
ย
30.05.2020
@xf3l1x
f3l1x.io
accepted!
(latte examples)
jsfiddle.net
codesandbox.io
Github Codespaces
regex101.com
3v4l.org
php.wtf
phpstan.org
getrector.org
tinkerwell.app
3v4l.org (php.wtf)
phpstan.org
getrector.org
tinkerwell.app
w3schools.com
phpfiddle.org
onlinephpfunctions.com
writephponline.com
phptester.net
paiza.io
ARE YOU F*'N KIDDING ME?
Charged 24/7ย
Maintenance
Security updates
Scaling up/down
emconfigure ./configure \
--disable-all \
--disable-cgi \
--disable-cli \
--disable-rpath \
--disable-phpdbg \
--with-valgrind=no \
--without-pear \
--without-pcre-jit \
--with-layout=GNU \
--enable-embed=static \
--enable-bcmath \
--enable-json \
--enable-ctype \
--enable-mbstring \
--disable-mbregex \
--enable-tokenizer
emcc -O3 \
--llvm-lto 2 \
-s ENVIRONMENT=web \
-s EXPORTED_FUNCTIONS='["_pib_eval", "_php_embed_init", "_zend_eval_string", "_php_embed_shutdown"]' \
-s EXTRA_EXPORTED_RUNTIME_METHODS='["ccall"]' \
-s MODULARIZE=1 \
-s EXPORT_NAME="'PHP'" \
-s TOTAL_MEMORY=134217728 \
-s ASSERTIONS=0 \
-s INVOKE_RUN=0 \
-s ERROR_ON_UNDEFINED_SYMBOLS=0 \
--preload-file Zend/bench.php \
libs/libphp7.a pib_eval.o -o out/php.js
{
"functions": {
}
}
now.json
{
"functions": {
"api/index.php": {
"runtime": "now-php@0.0.9"
}
}
}
now.json
WEB
Text
STORAGE
NETTE
STRINGS
a
TIME
XYZ
ANALYTICS
SERVICES
UI
DB
(mysql)
save
UI
load
<TEXTAREA>
<CODE>
lessik
serverless
lesรญk
lessik
โโโ services
โ โโโ nette (PHP)
โ โ โโโ api/*.php
โ โ โโโ src
โ โ โโโ now.json
โ โ โโโ composer.json
โ โโโ strings (PHP)
โ โ โโโ api/*.php
โ โ โโโ src
โ โ โโโ now.json
โ โ โโโ composer.json
โ โโโ time (PHP)
โ โ โโโ api/*.php
โ โ โโโ src
โ โ โโโ now.json
โ โ โโโ composer.json
โโโ sites (JS, TS, Vue)
โ โโโ lessik
โ โโโ src
โ โโโ now.json
โ โโโ tsconfig.json
โ โโโ tailwind.config.js
โ โโโ package.json
โโโ Makefile
make sites-lessik-dev
make services-nette-dev
make services-strings-dev
0.0.0.0:1234
Parcel JS
PHP built-in server
0.0.0.0:8000
PHP built-in server
0.0.0.0:8001
terminals
app.ts
export const NAME = "LESSIK";
export const VERSION = "v0.1";
// Services
export const SERVICE_NETTE =
process.env.SERVICE_NETTE || 'http://0.0.0.0:8000';
export const SERVICE_STRINGS =
process.env.SERVICE_STRINGS || 'http://0.0.0.0:8001';
request & response
const output = await fetch(SERVICE_NETTE, {body});
<?php declare(strict_types = 1);
$latte = Request::param('code');
$output = ['result' => Runner::doLatte($latte)];
Response::header('content-type', 'application/json');
Response::code(200);
echo Json::encode($output);
exit();
Web UI (0.0.0.0:1234)
Nette Service (0.0.0.0:8000)
strings-v1.felix.tld
nette-v1.felix.tld
monitoring
telemetry logs
error handling
analytics
custom
web
think big
take challenges
explore & conquer
share experience
have fun
๐คฉ ๐ข
@xf3l1x
f3l1x.io
?
What? Why? How? No? Oh.
@xf3l1x
f3l1x.io