full frontend refactor
This commit is contained in:
@@ -60,10 +60,9 @@ defmodule MoundHuntersWeb.TileController do
|
||||
|
||||
@doc """
|
||||
Serve a tile file.
|
||||
GET /tiles/MOUND/:tile_id.mound
|
||||
GET /tiles/JPG/:tile_id.jpg
|
||||
GET /tiles/PNG/:tile_id.jpng
|
||||
GET /tiles/JSON/:tile_id.json
|
||||
GET /tiles/mound/:tile_id.mound
|
||||
GET /tiles/jpg/:tile_id.jpg
|
||||
GET /tiles/png/:tile_id.jpng
|
||||
"""
|
||||
def serve(conn) do
|
||||
raw_tile_id = conn.path_params["tile_id"]
|
||||
@@ -81,10 +80,9 @@ defmodule MoundHuntersWeb.TileController do
|
||||
|
||||
file_path =
|
||||
case format do
|
||||
"MOUND" -> Path.join(tile_dir, "MOUND/#{tile_id}.mound")
|
||||
"JSON" -> Path.join(tile_dir, "JSON/#{tile_id}.json")
|
||||
"JPG" -> Path.join(tile_dir, "JPG/#{tile_id}.jpg")
|
||||
"PNG" -> Path.join(tile_dir, "PNG/#{tile_id}.png")
|
||||
"mound" -> Path.join(tile_dir, "MOUND/#{tile_id}.mound")
|
||||
"jpg" -> Path.join(tile_dir, "JPG/#{tile_id}.jpg")
|
||||
"png" -> Path.join(tile_dir, "PNG/#{tile_id}.png")
|
||||
end
|
||||
|
||||
Logger.info("Tile request started for #{file_path}")
|
||||
|
||||
Reference in New Issue
Block a user