diff --git a/sanic/config.py b/sanic/config.py index e3563bc1..f5649cfe 100644 --- a/sanic/config.py +++ b/sanic/config.py @@ -201,4 +201,10 @@ class Config(dict): for k, v in os.environ.items(): if k.startswith(SANIC_PREFIX): _, config_key = k.split(SANIC_PREFIX, 1) - self[config_key] = v + try: + self[config_key] = int(v) + except ValueError: + try: + self[config_key] = float(v) + except ValueError: + self[config_key] = v