
import os

from dmutils import init_manager

from app import create_app

application = create_app(os.getenv('DM_ENVIRONMENT') or 'development')
manager = init_manager(application, 5000, ['./json_schemas'])


@manager.command
def update_index(index_name):
    from app.main.services.search_service import create_index
    with application.app_context():
        message, status = create_index(index_name)
    assert status == 200, message
    application.logger.info("Created index %s", index_name)


if __name__ == '__main__':
    manager.run()


import os

from dmutils import init_manager

from app import create_app

application = create_app(os.getenv('DM_ENVIRONMENT') or 'development')
manager = init_manager(application, 5001, ['./mappings'])


@manager.command
def update_index(index_name):
    from app.main.services.search_service import create_index
    with application.app_context():
        message, status = create_index(index_name)
    assert status == 200, message
    application.logger.info("Created index %s", index_name)


if __name__ == '__main__':
    manager.run()

Fix local search-api port to 5001
Fix local search-api port to 5001

When upgrading dmutils I've copied the new `init_manager` code from
the API but forgot to update the port.

Also adds mappings to the list of watched locations for the development
server, so the app will restart if the files are modified.

  
  import os
  
  from dmutils import init_manager
  
  from app import create_app
  
  application = create_app(os.getenv('DM_ENVIRONMENT') or 'development')
- manager = init_manager(application, 5000, ['./json_schemas'])
+ manager = init_manager(application, 5001, ['./mappings'])
  
  
  @manager.command
  def update_index(index_name):
      from app.main.services.search_service import create_index
      with application.app_context():
          message, status = create_index(index_name)
      assert status == 200, message
      application.logger.info("Created index %s", index_name)
  
  
  if __name__ == '__main__':
      manager.run()
  
Fix local search-api port to 5001
## Code Before:

import os

from dmutils import init_manager

from app import create_app

application = create_app(os.getenv('DM_ENVIRONMENT') or 'development')
manager = init_manager(application, 5000, ['./json_schemas'])


@manager.command
def update_index(index_name):
    from app.main.services.search_service import create_index
    with application.app_context():
        message, status = create_index(index_name)
    assert status == 200, message
    application.logger.info("Created index %s", index_name)


if __name__ == '__main__':
    manager.run()

## Instruction:
Fix local search-api port to 5001
## Code After:

import os

from dmutils import init_manager

from app import create_app

application = create_app(os.getenv('DM_ENVIRONMENT') or 'development')
manager = init_manager(application, 5001, ['./mappings'])


@manager.command
def update_index(index_name):
    from app.main.services.search_service import create_index
    with application.app_context():
        message, status = create_index(index_name)
    assert status == 200, message
    application.logger.info("Created index %s", index_name)


if __name__ == '__main__':
    manager.run()
