-
Notifications
You must be signed in to change notification settings - Fork 3
/
app.py
executable file
·33 lines (25 loc) · 941 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
'''
app.py is the starting point of the application; to run the app, in the console, you run "python app.py"
This file should not change often, except maybe to rename the application from "app" to something more meaningful
such as "helloWorldForm"
To rename the app, you need to make three changes:
1) Change "from app import app" to "from helloWorldForm import app"
2) Rename the "app" folder to "helloWorldForm"
3) Rename this file to "helloWorldForm.py"
'''
import os
from app import app
import ipfsapi
# Builds the server configuration
if os.getenv('IP'):
IP = os.getenv('IP')
else:
IP = '0.0.0.0'
if os.getenv('PORT'):
PORT = int(os.getenv('PORT'))
else:
PORT = 8081
# Print statements go to your log file in production; to your console while developing
api = ipfsapi.connect('127.0.0.1', 5001)
print ("Running server at http://{0}:{1}/".format(IP, PORT))
app.run(host = IP, port = PORT, debug = True, threaded = True)