6API setup example for PyXMake.
8@note: Run HTML APIs of PyXMake (in a Docker container or locally).
12----------------------------------------------------------------------------------------------
19@author: garb_ma [DLR-SY,STM Braunschweig]
20----------------------------------------------------------------------------------------------
30 sys.path.insert(0,os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
38 Hostname=str(platform.node()), PortID=8020,
42 Main function to execute an API handle
50 if Coverage.show()
or kwargs.get(
"dry_run",
False):
52 from fastapi.testclient
import TestClient
54 client = TestClient(
handle())
56 assert client.get(posixpath.sep).status_code == 200
58 print(
"==================================")
59 print(
"Finished running API check")
60 print(
"==================================")
66 uvicorn.run(
handle(), host=Hostname, port=PortID)
72 Return current API's main instance as an sub API.
75 API.RedirectException(posixpath.sep.join([
"",str(PyXMake.__name__),
"api",
"documentation"]))
81if __name__ ==
'__main__':
83 API is initialized and run.
86 main(handle); sys.exit()
Class instance to define PyXMake's web API instance.
Contains all classes and functions to create a web application.
Create a make object to define the building environment.
main(handle, Hostname=str(platform.node()), PortID=8020, **kwargs)