Skip to content

Commit e3e0d2f

Browse files
committed
Changed homepage to answer with error if missing HOME_DOMAIN.
1 parent befa900 commit e3e0d2f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

web/websearch.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,15 @@ def update(domain):
599599
"""
600600
@app.route('/')
601601
def home():
602-
home_domain = getenv('HOME_DOMAIN', 'www.maptiler.com')
602+
home_domain = getenv('HOME_DOMAIN', request.args.get('domain'))
603+
data = {
604+
'query': '',
605+
'route': '/',
606+
'template': 'answer.html'
607+
}
608+
if not home_domain:
609+
data['result'] = {'error': 'Missing HOME_DOMAIN, specify in the query ?domain='}
610+
return formatResponse(data, 400)
603611
return render_template('home.html', route='/search', domain=home_domain)
604612

605613

0 commit comments

Comments
 (0)