Jarvislabs.ai

Flask API

Lets run a hello world example from the Flask Quick start guide.

A minimal Flask application looks something like this and we will save in a file called hello.py

from flask import Flask

app = Flask(__name__)

@app.route("/")
def hello_world():
    return "<p>Hello, World!</p>"

Open a terminal on your instance and run the below code.

export FLASK_APP=hello
flask run --host=0.0.0.0 --port=6006

If your flask server is running then go to Jarvislabs.ai dashboard and right click 👆 on your instance and choose API endpoint.

Jarvislabs.ai API endpoint

And start using it 😀.

Previous
Deploy