
import os
from marv_cli import setup_logging
setup_logging(os.environ.get('MARV_LOGLEVEL', 'info'))

config = os.environ['MARV_CONFIG']
app_root = os.environ['MARV_APPLICATION_ROOT']

import marv.app
import marv.site
site = marv.site.Site(config)
site.load_for_web()
application = marv.app.create_app(site, app_root=app_root, checkdb=True)


import os
from marv_cli import setup_logging
setup_logging(os.environ.get('MARV_LOGLEVEL', 'info'))

config = os.environ['MARV_CONFIG']
app_root = os.environ.get('MARV_APPLICATION_ROOT') or '/'

import marv.app
import marv.site
site = marv.site.Site(config)
site.load_for_web()
application = marv.app.create_app(site, app_root=app_root, checkdb=True)

Make fetching application root from env less error-prone
[marv] Make fetching application root from env less error-prone

  
  import os
  from marv_cli import setup_logging
  setup_logging(os.environ.get('MARV_LOGLEVEL', 'info'))
  
  config = os.environ['MARV_CONFIG']
- app_root = os.environ['MARV_APPLICATION_ROOT']
+ app_root = os.environ.get('MARV_APPLICATION_ROOT') or '/'
  
  import marv.app
  import marv.site
  site = marv.site.Site(config)
  site.load_for_web()
  application = marv.app.create_app(site, app_root=app_root, checkdb=True)
  
Make fetching application root from env less error-prone
## Code Before:

import os
from marv_cli import setup_logging
setup_logging(os.environ.get('MARV_LOGLEVEL', 'info'))

config = os.environ['MARV_CONFIG']
app_root = os.environ['MARV_APPLICATION_ROOT']

import marv.app
import marv.site
site = marv.site.Site(config)
site.load_for_web()
application = marv.app.create_app(site, app_root=app_root, checkdb=True)

## Instruction:
Make fetching application root from env less error-prone
## Code After:

import os
from marv_cli import setup_logging
setup_logging(os.environ.get('MARV_LOGLEVEL', 'info'))

config = os.environ['MARV_CONFIG']
app_root = os.environ.get('MARV_APPLICATION_ROOT') or '/'

import marv.app
import marv.site
site = marv.site.Site(config)
site.load_for_web()
application = marv.app.create_app(site, app_root=app_root, checkdb=True)
