mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
replace make serve with nominatim serve command
With the website directory now tied to the project directory instead of the build directory, it is no longer possible to use make for running the web server.
This commit is contained in:
@@ -11,7 +11,7 @@ import logging
|
||||
from pathlib import Path
|
||||
|
||||
from .config import Configuration
|
||||
from .tools.exec_utils import run_legacy_script, run_api_script
|
||||
from .tools.exec_utils import run_legacy_script, run_api_script, run_php_server
|
||||
from .db.connection import connect
|
||||
from .db import status
|
||||
from .errors import UsageError
|
||||
@@ -633,6 +633,28 @@ class QueryExport:
|
||||
|
||||
return run_legacy_script(*params, nominatim_env=args)
|
||||
|
||||
|
||||
class AdminServe:
|
||||
"""\
|
||||
Start a simple web server for serving the API.
|
||||
|
||||
This command starts the built-in PHP webserver to serve the website
|
||||
from the current project directory. This webserver is only suitable
|
||||
for testing and develop. Do not use it in production setups!
|
||||
|
||||
By the default, the webserver can be accessed at: http://127.0.0.1:8088
|
||||
"""
|
||||
|
||||
@staticmethod
|
||||
def add_args(parser):
|
||||
group = parser.add_argument_group('Server arguments')
|
||||
group.add_argument('--server', default='127.0.0.1:8088',
|
||||
help='The address the server will listen to.')
|
||||
|
||||
@staticmethod
|
||||
def run(args):
|
||||
run_php_server(args.server, args.project_dir / 'website')
|
||||
|
||||
STRUCTURED_QUERY = (
|
||||
('street', 'housenumber and street'),
|
||||
('city', 'city, town or village'),
|
||||
@@ -895,6 +917,7 @@ def nominatim(**kwargs):
|
||||
parser.add_subcommand('refresh', UpdateRefresh)
|
||||
|
||||
parser.add_subcommand('export', QueryExport)
|
||||
parser.add_subcommand('serve', AdminServe)
|
||||
|
||||
if kwargs.get('phpcgi_path'):
|
||||
parser.add_subcommand('search', APISearch)
|
||||
|
||||
Reference in New Issue
Block a user