Skip to content

Commit 0f74abc

Browse files
chenyumicengelke
chenyumic
authored andcommitted
Added sample for using custom server. (GoogleCloudPlatform#1833)
1 parent 8b01df8 commit 0f74abc

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# [START gae_python37_custom_runtime]
2+
runtime: python37
3+
entrypoint: uwsgi --http-socket :8080 --wsgi-file main.py --callable app --master --processes 1 --threads 2
4+
# [END gae_python37_custom_runtime]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright 2018 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from flask import Flask
16+
17+
app = Flask(__name__)
18+
19+
20+
@app.route('/')
21+
def main():
22+
return 'Hello, World!'
23+
24+
25+
if __name__ == '__main__':
26+
app.run(debug=True)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
uwsgi==2.0.17.1
2+
flask==1.0.2

0 commit comments

Comments
 (0)