from typing import Union
import json


def http_response(data: dict, status_code: Union[str, int] = '200') -> dict:
    """return http response

    Args:
        data: object to return.
        status_code: HTTP status code.
            Defaults to '200'.
    """
    resp = {
        'statusCode': str(status_code),
        'headers': {
            'Content-Type': 'application/json',
            'Access-Control-Allow-Origin': 'papertesla.com'
        },
        'body': json.dumps(data)
    }
    return resp