mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🎨 Add more file formats supporting snapshots comparing https://github.com/siyuan-note/siyuan/issues/8438
This commit is contained in:
parent
e50a9b4e11
commit
30e70ade73
3 changed files with 47 additions and 2 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue