Hello, I am developing a react-native mobile app where I want to access some APIs from a localhost development server for ERPNext. The dev server is running on development.localhost:8000
. It seems that I have to use an IP address instead of the hostname to access it from mobile app. But when I go to http://192.168.x.x:8000
, I get a 404. Please advise.
Access Local Frappe Site from Another Device follow below methods:
- First assign port(run this command in terminal)
python3 -m http.server 8000
- Specify the site you want to work with
bench use development.localhost
- Modify the site_config.json file in the site directory (sites/development.localhost/site_config.json) to include your local IP address under the hosts field.
{
"db_name": "_8060c79548cd5f631",
"db_password": "DVK9wS17O4yqOEeGi",
"db_type": "mariadb",
"developer_mode": 1,
"hosts": ["localhost", "127.0.0.1", "192.168.1.30"],
"user_type_doctype_limit": { "employee_self_service": 30 }
}
Replace 192.168.1.30 with the actual IP address of your computer, which you can find using ifconfig or ip addr.
Access from Another Device
Ensure that your Frappe Bench server is running. Then, access your site from another device on the same network by navigating to: http://192.168.1.30:8000