Skip to content

Commit 1c2e635

Browse files
committed
Updated docs
1 parent 106e6ad commit 1c2e635

File tree

4 files changed

+48
-5
lines changed

4 files changed

+48
-5
lines changed

docs/examples.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Examples
2+
3+
```bash
4+
pip install py-ms
5+
```
6+
7+
config.yml:
8+
9+
```yaml
10+
my-minimal-microservice:
11+
APP_NAME: "Python Microservice"
12+
```
13+
14+
main.py
15+
16+
```python
17+
from flask import jsonify
18+
19+
from pyms.flask.app import Microservice
20+
21+
ms = Microservice(service="my-minimal-microservice", path=__file__)
22+
app = ms.create_app()
23+
24+
25+
@app.route("/")
26+
def example():
27+
return jsonify({"main": "hello world"})
28+
29+
30+
if __name__ == '__main__':
31+
app.run()
32+
```
33+
34+
```bash
35+
python main.py
36+
```
37+
38+
Open in your browser http://localhost:5000/
39+
40+
See [this Github page](https://github.com/python-microservices/pyms/tree/master/examples) to see a examples

docs/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ microservices with Python.
88
* [Configuration](configuration.md)
99
* [Services](services.md)
1010
* [Microservice class](ms_class.md)
11-
* Quick start - minimum project
12-
* Structure of a microservice project
13-
* Swagger and connexion
14-
* Tracing requests
11+
* [Quick start and examples](examples.md)
12+
* [Structure of a microservice project](structure_project.md)
13+
* Swagger and connexion
14+
* Tracing requests
1515
* [Services of PyMS](structure.md)

docs/ms_class.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,4 @@ spec:
9292
name: my-microservice-configmap
9393
```
9494

95-
See more examples in TODO: add link
95+
See more examples in [this Github page](https://github.com/python-microservices/pyms/tree/master/examples)

docs/structure_project.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#Project structure
2+
3+
See [Microservice Scaffold](https://microservices-scaffold.readthedocs.io/en/latest/structure.html) for more info.

0 commit comments

Comments
 (0)