mirror of
https://github.com/maputnik/editor.git
synced 2026-07-25 23:37:27 +00:00
Support saving file
This commit is contained in:
+3
-3
@@ -39,9 +39,9 @@ func main() {
|
||||
// Allow access to reading and writing file on the local system
|
||||
path, _ := filepath.Abs(filename)
|
||||
accessor := StyleFileAccessor(path)
|
||||
router.Path("/files").Methods("GET").HandlerFunc(accessor.ListFiles)
|
||||
router.Path("/files/{filename}").Methods("GET").HandlerFunc(accessor.ReadFile)
|
||||
router.Path("/files/{filename}").Methods("PUT").HandlerFunc(accessor.SaveFile)
|
||||
router.Path("/styles").Methods("GET").HandlerFunc(accessor.ListFiles)
|
||||
router.Path("/styles/{styleId}").Methods("GET").HandlerFunc(accessor.ReadFile)
|
||||
router.Path("/styles/{styleId}").Methods("PUT").HandlerFunc(accessor.SaveFile)
|
||||
|
||||
// Register websocket to notify we clients about file changes
|
||||
if c.Bool("watch") {
|
||||
|
||||
Reference in New Issue
Block a user