@@ -36,7 +36,7 @@ git clone https://github.com/LinuxForHealth/x12
36
36
cd x12
37
37
38
38
python3 -m venv venv && source venv/bin/activate && pip install --upgrade pip setuptools
39
- pip install -e .[dev]
39
+ pip install -e .[dev, api] # installs dev packages and optional API endpoint
40
40
pytest
41
41
```
42
42
@@ -130,6 +130,27 @@ To parse a X12 message into models with pretty printing enabled
130
130
131
131
In " model" mode, the ` -x` option excludes ` None` values from output.
132
132
133
+ # ## API
134
+ LinuxForHealth X12 includes an experimental " api" setup " extra" which activates a [Fast API](https://fastapi.tiangolo.com/)
135
+ endpoint used to submit X12 payloads.
136
+
137
+ ` ` ` shell
138
+ user@mbp x12 % source venv/bin/activate
139
+ (venv) user@mbp x12 % pip install -e " .[api]"
140
+ (venv) user@mbp x12 % lfhx12-api
141
+ ` ` `
142
+ Browse to http://localhost:5000/docs to view the Open API UI.
143
+
144
+ API server configurations are located in the [config module](./src/linuxforhealth/x12/config.py). The ` X12ApiConfig` model
145
+ is a [Pydantic Settings Model](https://pydantic-docs.helpmanual.io/usage/settings/) which can be configured using environment
146
+ variables.
147
+
148
+ ` ` ` shell
149
+ user@mbp x12 % source venv/bin/activate
150
+ (venv) user@mbp x12 % export X12_UVICORN_PORT=5002
151
+ (venv) user@mbp x12 % lfhx12-api
152
+ ` ` `
153
+
133
154
# ## Code Formatting
134
155
135
156
LinuxForHealth X12 adheres to the [Black Code Style and Convention](https://black.readthedocs.io/en/stable/index.html)
@@ -161,3 +182,4 @@ python3 -m build --no-isolation
161
182
# # Additional Resources
162
183
- [Design Overview](repo-docs/DESIGN.md)
163
184
- [New Transaction Support](repo-docs/NEW_TRANSACTION.md)
185
+ - [Container Support](repo-docs/CONTAINER_SUPPORT.md)
0 commit comments