-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebwords
23 lines (20 loc) · 889 Bytes
/
webwords
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/python
#=======================================================================
# Example script to run wordsapp web application either as a CGI script
# or as a stand-alone server
#=======================================================================
import os
import sys
sys.path.append(os.path.expanduser('~/wordgames/python'))
from wsgiref.handlers import CGIHandler
os.environ['D2DICT'] = os.path.expanduser('~/.local/share/moby')
os.environ['WORDSBIN'] = os.path.expanduser('~/wordgames')
#os.environ['WORDSLINK'] = 'http://www.dictionary.com/browse/{}'
#os.environ['WORDSLINK'] = 'https://www.onelook.com?w={}'
os.environ['WORDSLINK'] = 'https://www.oxforddictionaries.com/definition/{}'
from wordsapp import app
if 'GATEWAY_INTERFACE' in os.environ:
from wsgiref.handlers import CGIHandler
CGIHandler().run(app)
else:
app.run(host='0.0.0.0', port=8080)