You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
433 B
23 lines
433 B
from flask import Flask, jsonify
|
|
import numpy as np
|
|
|
|
app = Flask(__name__)
|
|
|
|
|
|
@app.route('/')
|
|
def hello_world():
|
|
# Genereer een willekeurige matrix van 3x3 met NumPy
|
|
matrix = np.random.rand(3, 3).tolist()
|
|
|
|
# Maak een bericht met de matrix
|
|
message = {
|
|
"message": "Welkom bij de Flask API!",
|
|
"random_matrix": matrix
|
|
}
|
|
|
|
return jsonify(message)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
app.run(debug=True)
|