MCPcopy Create free account
hub / github.com/SurceBeats/Atlas / register_location_api

Function register_location_api

pymodules/__frontendAPI_location_data.py:122–137  ·  view source on GitHub ↗
(app)

Source from the content-addressed store, hash-verified

120
121
122def register_location_api(app):
123
124 @app.route("/api/planet/<planet_name>/location-data")
125 def get_planet_location_api(planet_name):
126 data = get_complete_location_data(planet_name)
127 return jsonify(data)
128
129 @app.route("/api/current-location")
130 def get_current_location():
131 galaxy_data = session.get("galaxy")
132 system_index = session.get("system")
133
134 if not galaxy_data or system_index is None:
135 return jsonify({"error": "No current location in session"})
136
137 return jsonify({"galaxy_coordinates": galaxy_data["coordinates"], "system_index": system_index})

Callers 1

__main__.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected