"""Provides an example of attaching an action on hug server startup"""
import hug

data = []


@hug.startup()
def add_data(api):
    """Adds initial data to the api on startup"""
    data.append("It's working")


@hug.startup()
def add_more_data(api):
    """Adds initial data to the api on startup"""
    data.append("Even subsequent calls")


@hug.get()
def test():
    """Returns all stored data"""
    return data

"""Provides an example of attaching an action on hug server startup"""
import hug

data = []


@hug.startup()
def add_data(api):
    """Adds initial data to the api on startup"""
    data.append("It's working")


@hug.startup()
def add_more_data(api):
    """Adds initial data to the api on startup"""
    data.append("Even subsequent calls")


@hug.cli()
@hug.get()
def test():
    """Returns all stored data"""
    return data

Update example to demonstrate desired use case
Update example to demonstrate desired use case

  """Provides an example of attaching an action on hug server startup"""
  import hug
  
  data = []
  
  
  @hug.startup()
  def add_data(api):
      """Adds initial data to the api on startup"""
      data.append("It's working")
  
  
  @hug.startup()
  def add_more_data(api):
      """Adds initial data to the api on startup"""
      data.append("Even subsequent calls")
  
  
+ @hug.cli()
  @hug.get()
  def test():
      """Returns all stored data"""
      return data
  
Update example to demonstrate desired use case
## Code Before:
"""Provides an example of attaching an action on hug server startup"""
import hug

data = []


@hug.startup()
def add_data(api):
    """Adds initial data to the api on startup"""
    data.append("It's working")


@hug.startup()
def add_more_data(api):
    """Adds initial data to the api on startup"""
    data.append("Even subsequent calls")


@hug.get()
def test():
    """Returns all stored data"""
    return data

## Instruction:
Update example to demonstrate desired use case
## Code After:
"""Provides an example of attaching an action on hug server startup"""
import hug

data = []


@hug.startup()
def add_data(api):
    """Adds initial data to the api on startup"""
    data.append("It's working")


@hug.startup()
def add_more_data(api):
    """Adds initial data to the api on startup"""
    data.append("Even subsequent calls")


@hug.cli()
@hug.get()
def test():
    """Returns all stored data"""
    return data
