Commit 5e26a219 authored by Christian Wander's avatar Christian Wander
Browse files

begin with initial config stuff

parent c40bfc6d
from pixelframe import app
from flask import render_template
from flask import render_template, request
import pixelframe.pixel_service as pixel_service
import pixelframe.image_config as config
def main_page():
return render_template('main.html')
return "This is the main page"
def hello_method():
return render_template('hello.html', name="foo")
@app.route('/start', methods=["POST"])
def start_pixels():
return "Started work."
@app.route('/stop', methods=["POST"])
def stop_pixels():
return "Stopped work"
@app.route('/images', methods=["GET", "POST"])
def images():
Endpoint used to set/get the image configuration
if request.method == 'POST':
print(f'>> receiving: {request.json}')
return config.config
config = {
"path": "data",
"images": [
def update(data):
# TODO: Check if there's something better to validate json data
print(f'>> updating config: {data}')
if "images" in data:
config['images'] = data['images']
if "path" in data:
config['path'] = data['path']
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment