idk anymore man
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
"""
|
||||
This is the Amethyst API mode Python interface whatevers.
|
||||
Docs will follow.
|
||||
"""
|
||||
|
||||
# Below go imports.
|
||||
import sys
|
||||
import os
|
||||
|
||||
if not os.getcwd() in sys.path:
|
||||
sys.path.append(os.getcwd())
|
||||
import pywebsrv
|
||||
|
||||
|
||||
class API:
|
||||
"""
|
||||
class
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
# DO NOT USE THIS CLASS FOR PROGRAM, ONLY ON_REQUEST PLEASE!!
|
||||
# Below go definitions to get things working.
|
||||
self.build_response = pywebsrv.WebServer.build_binary_response
|
||||
|
||||
def on_request(self, req):
|
||||
return self.build_response(200, "This is a test", "text/html")
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
<h1>Hello from Amethyst!</h1>
|
||||
<h2>This page confirms Amethyst can read files from your PC and serve them to your browser!</h2>
|
||||
<p>If you see this page and you're not the server owner, tell them they misconfigured something!</p>
|
||||
<p>This server runs Amethyst Alpha Build 0039</p>
|
||||
<p>This server runs Amethyst Alpha Build 0048</p>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user