File size: 518 Bytes
e74c73c
 
 
0481dd5
e74c73c
0481dd5
e74c73c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import pynecone as pc

config = pc.Config(
    app_name="news_pynecone",
    db_url="sqlite:///pynecone.db",
    api_url="https://timho102003-news_pynecone.hf.space/pynecone-backend",
    env=pc.Env.PROD,
)

### PATCHING 'get_api_port'
from pynecone import utils

initial_get_api_port = utils.get_api_port


def patched_get_api_port() -> int:
    print(f"Using patched get_api_port (return 8000)")
    return 8000


utils.get_api_port = patched_get_api_port
print(f"Patched 'get_api_port' to always return 8000.")
###