start work

This commit is contained in:
Nyx 2025-04-05 23:59:04 -05:00
parent 6ca0ab77b9
commit e1ccd33636
3 changed files with 45 additions and 0 deletions

13
app/app.py Normal file
View file

@ -0,0 +1,13 @@
from flask import Flask, render_template, make_response, send_from_directory
import os
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.xht')
@app.route('/fortune')
def fortune():
fortune = os.run('/usr/bin/fortune')
return render_template('fortune.j2', fortune=fortune)

15
app/templates/fortune.j2 Normal file
View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>fortune as a service</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
<h1>fortune as a service</h1>
<p>
your fortune is: {{ fortune }}
</p>
<a href="/fortune">get a new fortune</a>
</body>

17
app/templates/index.xht Normal file
View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>fortune as a service</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
<h1>fortune as a service</h1>
<p>
fortune as a service is a simple web application that provides random fortunes,
from the /usr/bin/fortune command on Arch Linux, with our patent-pending AI Layer
2 code execution engine.
</p>
<a href="/fortune">get a fortune</a>
</body>