File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change
1
+ from freenit .api import register_endpoints
2
+
3
+
4
+ def create_api (app ):
5
+ register_endpoints (app , '/api/v0' , [])
Original file line number Diff line number Diff line change 1
1
import os
2
2
import socket
3
+ from importlib import import_module
3
4
4
- from config import configs
5
5
from freenit import create_app
6
6
7
+ from config import configs
8
+ from name import app_name
9
+
10
+ api = import_module (f'{ app_name } .api' )
7
11
config_name = os .getenv ('FLASK_ENV' ) or 'default'
8
12
config = configs [config_name ]
13
+ # schemas = {
14
+ # 'user': f'{app_name}.schemas.user',
15
+ # }
16
+ # app = create_app(config, schemas=schemas)
9
17
app = create_app (config )
18
+ api .create_api (app )
10
19
hostname = socket .gethostname ()
11
20
port = os .environ .get ('FLASK_PORT' , 5000 )
12
21
REDOC_PATH = f'{ config .OPENAPI_URL_PREFIX } { config .OPENAPI_REDOC_PATH } '
Original file line number Diff line number Diff line change 9
9
10
10
setup (
11
11
name = 'freenit' ,
12
- version = '0.0.19 ' ,
12
+ version = '0.0.20 ' ,
13
13
description = 'REST API framework based on Flask-Smorest' ,
14
14
long_description = README ,
15
15
long_description_content_type = 'text/markdown' ,
56
56
'templates/*' ,
57
57
'project/*' ,
58
58
'project/bin/*' ,
59
+ 'project/api/*' ,
59
60
'project/models/*' ,
60
61
]
61
62
},
You can’t perform that action at this time.
0 commit comments