🎨 Add more file formats supporting snapshots comparing https://github.com/siyuan-note/siyuan/issues/8438

This commit is contained in:
Daniel 2023-06-03 17:42:01 +08:00
parent e50a9b4e11
commit 30e70ade73
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 47 additions and 2 deletions

View file

@ -75,6 +75,7 @@ func Serve(fastMode bool) {
servePlugins(ginServer)
serveEmojis(ginServer)
serveTemplates(ginServer)
serveRepoDiff(ginServer)
api.ServeAPI(ginServer)
var host string
@ -349,6 +350,15 @@ func serveAssets(ginServer *gin.Engine) {
})
}
func serveRepoDiff(ginServer *gin.Engine) {
ginServer.GET("/repo/diff/*path", model.CheckAuth, func(context *gin.Context) {
requestPath := context.Param("path")
p := filepath.Join(util.TempDir, "repo", "diff", requestPath)
http.ServeFile(context.Writer, context.Request, p)
return
})
}
func serveDebug(ginServer *gin.Engine) {
ginServer.GET("/debug/pprof/", gin.WrapF(pprof.Index))
ginServer.GET("/debug/pprof/allocs", gin.WrapF(pprof.Index))