File tree Expand file tree Collapse file tree 2 files changed +25
-28
lines changed
Expand file tree Collapse file tree 2 files changed +25
-28
lines changed Original file line number Diff line number Diff line change @@ -65,14 +65,14 @@ if __name__ == '__main__':
6565config.yml
6666``` yaml
6767pyms :
68- services: # 1.2
69- requests:
70- data: {}
71- config: # 1.3
72- DEBUG: true
73- APP_NAME: business-glossary
74- APPLICATION_ROOT : ""
75- SECRET_KEY: "gjr39dkjn344_!67#"
68+ services : # 1.2
69+ requests :
70+ data : {}
71+ config : # 1.3
72+ DEBUG : true
73+ APP_NAME : business-glossary
74+ APPLICATION_ROOT : " "
75+ SECRET_KEY : " gjr39dkjn344_!67#"
7676` ` `
7777
7878### So what did that code do?
Original file line number Diff line number Diff line change @@ -19,29 +19,29 @@ a simple configuration file could be a config.yaml:
1919``` yaml
2020pyms :
2121 services :
22- requests: true
23- swagger:
24- path: ""
25- file: "swagger.yaml"
26- config:
27- debug: true
28- testing: false
29- app_name: "Python Microservice"
30- APPLICATION_ROOT: ""
22+ requests : true
23+ swagger :
24+ path : " "
25+ file : " swagger.yaml"
26+ config :
27+ debug : true
28+ testing : false
29+ app_name : " Python Microservice"
30+ APPLICATION_ROOT : " "
3131` ` `
3232
3333or in a config.json:
3434
3535` ` ` json
3636{
3737 " pyms " : {
38- "services" :{
39- "requests" : true ,
40- "swagger" : {
41- "path" : " " ,
42- "file" : " swagger.yaml"
43- }
44- },
38+ " services" :{
39+ " requests " : true,
40+ " swagger " : {
41+ " path " : " " ,
42+ " file " : " swagger.yaml"
43+ }
44+ },
4545 " config " : {
4646 " DEBUG " : true,
4747 " TESTING " : true,
@@ -75,7 +75,7 @@ and a `config.yaml` file:
7575``` yaml
7676pyms :
7777 services :
78- requests: true
78+ requests : true
7979` ` `
8080
8181our object ` ms` has an attribute `requests` that is a instance of our service [requests](services.md).
@@ -132,9 +132,6 @@ API = Api(
132132)
133133` ` `
134134
135- ** IMPORTANT:** If you use this method to get configuration out of context, you must set the ` CONFIGMAP_SERVICE ` or set
136- the default key ` ms ` for your configuration block in your config.yml
137-
138135
139136# # Looking for Configuration file with Kubernetes Configmaps
140137By default, Microservice class search a config.yml in the same path. You can set a different route or set a json file.
You can’t perform that action at this time.
0 commit comments