In this guide, we'll make our first Arkhos App with Python. We'll serve a basic HTML page and save POST requests to a database.
Create your first Arkhos app by going to getarkhos.com/apps and clicking New App. Choose a name for your app.
When you first create an Arkhos app, Arkhos will provide you with a new empty git repository to add your code. (You can also use an existing git repo.)
$ git remote add arkhos [email protected]:my-first-app.git
When you push code, Arkhos will build your code and deploy it for you.
Create a file main.py
with the following code
import arkhos
def arkhos_handler(request):
return arkhos.http('<h1>Hello World!</h1>')
That's it! The entry point to our code is arkhos_handler
. This function get's called when our function is triggered. Then we serve an HTML reponse with "Hello World!". Let's add this file to our git repo.
$ git add main.py
$ git commit -m "Hello world commit"
Now let's deploy by running git push.
$ git push arkhos
When you git push, Arkhos will take your latest code, package your dependencies, and deploy it for you.
When we created the app, Arkhos automatically set up a URL for us to run our function. You can find this URL under your app's info getarkhos.com/apps/my-first-app.
We can trigger our function simply by going to this URL in a browser. This will run our code, and serve the response.