You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This command will generate config and wrapper files. Depending on the options selected, you may need to adjust the generated code and config files. Follow the instructions provided in the command output.
73
83
84
+
#### Environment Variables
85
+
86
+
Add environment variables to `.upify/.env`
87
+
74
88
### Add a platform
75
89
76
90
To add cloud platform support, run:
@@ -87,18 +101,18 @@ To deploy your project, use the following command:
87
101
upify deploy [platform]
88
102
```
89
103
90
-
*Note: You must have your cloud credentials set up before deploying. See the [Authentication](#authentication) section for more details.*
104
+
*Note: You must have your cloud credentials set up before deploying. See the [Authentication](#provider-authentication) for more details.*
91
105
92
106
## Example projects
93
107
94
-
- [Flask](/examples/flask/README.md)
95
-
- [Express](/examples/express/README.md)
96
-
- [Python without a framework](/examples/python/README.md)
97
-
- [Javascript without a framework](/examples/javascript/README.md)
98
-
- [Typescript without a framework](/examples/typescript/README.md)
108
+
- [Flask](/examples/flask)
109
+
- [Express](/examples/express)
110
+
- [Python without a framework](/examples/python)
111
+
- [Javascript without a framework](/examples/javascript)
112
+
- [Typescript without a framework](/examples/typescript)
Upify uses wrapper files to adapt your application for cloud deployment:
11
+
12
+
## `upify_handler.[ext]`
13
+
This file is automatically generated for all projects to handle cloud platform integration. You shouldn't have to modify this file.
14
+
15
+
```python
16
+
import os
17
+
from main import app
18
+
19
+
handler =None
20
+
21
+
if os.getenv("UPIFY_DEPLOY_PLATFORM") =="aws-lambda":
22
+
from apig_wsgi import make_lambda_handler
23
+
handler = make_lambda_handler(app)
24
+
if os.getenv("UPIFY_DEPLOY_PLATFORM") =="gcp-cloudrun":
25
+
import functions_framework
26
+
27
+
@functions_framework.http
28
+
defflask_function(request):
29
+
with app.request_context(request.environ):
30
+
return app.full_dispatch_request()
31
+
32
+
handler = flask_function
33
+
```
34
+
35
+
## `upify_main.[ext]`
36
+
This file is only created for projects without a web framework. You'll need to modify it to adapt your non-web framework code to be able to handle HTTP requests/responses.
0 commit comments