Separated models, controllers and routers
This commit is contained in:
24
Floorplan/Router.fs
Normal file
24
Floorplan/Router.fs
Normal file
@@ -0,0 +1,24 @@
|
||||
module DredgePos.Floorplan.Router
|
||||
|
||||
open DredgePos
|
||||
open DredgePos.Types
|
||||
open Saturn
|
||||
open Giraffe
|
||||
|
||||
let floorplan = (warbler (fun ctx -> DredgePos.Floorplan.Controller.loadFloorplan (snd ctx)))
|
||||
|
||||
let router = router {
|
||||
pipe_through Ajax.Router.pipeline
|
||||
get "/" floorplan
|
||||
get "" floorplan
|
||||
post "/mergeTables" (bindJson<floorplan_table[]> Controller.mergeTables)
|
||||
post "/transformTable" (bindJson<floorplan_table> Controller.transformTable)
|
||||
post "/createTable" (bindJson<floorplan_table> Controller.createTable)
|
||||
post "/addDecoration" (bindJson<floorplan_decoration> Controller.AddDecoration)
|
||||
post "/updateDecoration" (bindJson<floorplan_decoration> Controller.UpdateDecoration)
|
||||
post "/deleteDecoration" (bindJson<floorplan_decoration> Controller.DeleteDecoration)
|
||||
post "/deleteTable" (bindJson<floorplan_table> Controller.deleteTable)
|
||||
getf "/getFloorplanData/%i" Controller.getFloorplanData
|
||||
getf "/transferTable/%i/%i" Controller.transferTable
|
||||
getf "/unmergeTable/%i" Controller.unmergeTable
|
||||
}
|
||||
Reference in New Issue
Block a user