Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flask integration of dash app #5

Closed
Nanguage opened this issue Sep 15, 2022 · 0 comments
Closed

Flask integration of dash app #5

Nanguage opened this issue Sep 15, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@Nanguage
Copy link
Owner

Nanguage commented Sep 15, 2022

Embeding the generated dash app as a route of flask server.

# demo_flask_integrate.py
from flask import Flask
from oneface.dash_app import flask_route
from oneface.core import one

server = Flask("test_dash_app")

@flask_route(server, "/add")
@one
def add(a: int, b: int) -> int:
    return a + b

@flask_route(server, "/mul")
@one
def mul(a: int, b: int) -> int:
    return a * b

server.run("127.0.0.1", 8088)

Run this will launch a flask server support run multiple dash app from different route.

References:

@Nanguage Nanguage changed the title Flask integration Flask integration of dash app Sep 15, 2022
@Nanguage Nanguage added the enhancement New feature or request label Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant