SmartCane/webapps/sugar_mill_locator/LOCAL_SERVER_SETUP.md
2026-01-06 14:17:37 +01:00

1.8 KiB

🚀 Quick Start - Run Local Server

The Sugar Mill Locator app needs to be served from a local web server to load the CSV file. The file:// protocol blocks this for security reasons.

On Windows PowerShell:

cd "c:\Users\timon\Resilience BV\4020 SCane ESA DEMO - Documenten\General\4020 SCDEMO Team\4020 TechnicalData\WP3\smartcane_v2\smartcane\webapps\sugar_mill_locator"
python -m http.server 8000

Then open: http://localhost:8000

Stop the server:

Press Ctrl+C in PowerShell


Option 2: Node.js (if you have it)

# Install http-server globally (one time)
npm install -g http-server

# Run it in the sugar_mill_locator folder
cd webapps/sugar_mill_locator
http-server -p 8000

Then open: http://localhost:8000


Option 3: Use webapps hub (all apps)

To run the main hub with all apps:

cd "c:\Users\timon\Resilience BV\4020 SCane ESA DEMO - Documenten\General\4020 SCDEMO Team\4020 TechnicalData\WP3\smartcane_v2\smartcane\webapps"
python -m http.server 8000

Then open: http://localhost:8000

This shows the dashboard with links to both apps.


Why This is Needed

  • file:// protocol = Direct file access (blocked CSV loading for security)
  • http:// protocol = Local web server (allows CSV loading)
  • Once deployed to Netlify or any web host, this won't be needed

Test Checklist

Server running (see "Listening on..." message) Open http://localhost:8000 in browser Should see map with colored mill circles Click a circle to see details Switch to "Draw & Add" to add new mills Draw point → form appears → fill details → export


All fixed! Just run the Python server command above. 🎉