-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmap.go
35 lines (28 loc) · 1.09 KB
/
map.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package khanmap
import (
"github.com/gofiber/fiber/v2"
"github.com/khankhulgun/khanmap/controllers"
"github.com/khankhulgun/khanmap/database/migrations"
"github.com/khankhulgun/khanmap/database/seeds"
"github.com/khankhulgun/khanmap/tiles"
"github.com/lambda-platform/lambda/agent/agentMW"
"github.com/lambda-platform/lambda/config"
)
func Set(app *fiber.App) {
app.Get("/tiles/:layer/:z/:x/:y.pbf", tiles.VectorTileHandler)
app.Get("/tiles/:layer/:z/:x/:y/:token.pbf", tiles.VectorTileHandlerWithToken)
app.Get("/saved-tiles/:layer/:z/:x/:y.pbf", tiles.SaveVectorTileHandler)
app.Get("/save-tile/:layer", tiles.SaveHandler)
a := app.Group("/mapserver/api")
a.Get("/geometry-tables", agentMW.IsLoggedIn(), controllers.GeometryTables)
a.Get("/table-columns/:schema/:table", agentMW.IsLoggedIn(), controllers.TableColumns)
a.Get("/map/:id", controllers.GetMapLayers)
a.Post("/spatial/:layer/:relationship", controllers.Spatial)
a.Post("/map-data", controllers.GetMapData)
if config.Config.App.Migrate == "true" {
migrations.Migrate()
}
if config.Config.App.Seed == "true" {
seeds.Seed()
}
}