import inspect import justpy as jp from webapp.home import Home from webapp.about import About from webapp.dictionary import Dictionary from webapp import page imports = list(globals().values()) for obj in imports: if inspect.isclass(obj): if issubclass(obj, page.Page) and obj is not page.Page: jp.Route(obj.path, obj.serve) # jp.Route(Home.path, Home.serve) # jp.Route(About.path, About.serve) # jp.Route(Dictionary.path, Dictionary.serve) jp.justpy()
import justpy as jp from webapp.about import About from webapp.home import Home from webapp.dictionary import Dictionary jp.Route(About.path, About.serve) jp.Route(Home.path, Home.serve) jp.Route(Dictionary.path, Dictionary.serve) jp.justpy(port=8006)
import api import documentation import justpy as jp jp.Route("/api", api.Api.serve) jp.Route("/", documentation.Doc.serve) jp.justpy()
import justpy as jp @jp.SetRoute('/') def html_comps(): wp = jp.WebPage() jp.Div(text='Text in italic', a=wp, classes='italic') jp.Div(text='Text in bold', a=wp, classes='font-bold') jp.Div(text='한글 입력', a=wp, classes='font-bold') return wp @jp.SetRoute('/bye') def bye_function(): wp = jp.WebPage() wp.add(jp.P(text='Goodbye!', classes='text-5xl m-2')) return wp def hello_function(): wp = jp.WebPage() wp.add(jp.P(text='Hello there!', classes='text-5xl m-2')) return wp jp.Route('/hello', hello_function) jp.justpy()
import inspect import justpy as jp from webapp.about import About from webapp.dictionary import Dictionary from webapp.home import Home from webapp import page imports = list(globals().values()) for obj in imports: if inspect.isclass(obj): if issubclass(obj, page.Page) and obj is not page.Page: jp.Route(path=obj.path, func_to_run=obj.serve) jp.justpy()