mirror of
https://github.com/schollz/cowyo.git
synced 2023-08-10 21:13:00 +03:00
Adding new route for viewing
Former-commit-id: cb10c6fcbd1aa6bf92d06cd2d8665887f5c2018b [formerly b5c933531b7b50a9cc39d462c975f280fd500518] [formerly 3fedbc58ecf2e91794c22e48d667e53d0083a164 [formerly bc44aafffac795fe1186dc61dd8eca229dbd0581 [formerly2be7c500a7
]]] Former-commit-id: 9640ab56ba31f79aa603326ddf56aeee2bcbbfb0 [formerly 8a40c159a0eb7de236f7f4600e9678bef91d907c] Former-commit-id: f27fb19a55aa7e7c88886c47136826d917c1aeb0 Former-commit-id:b94c81da30
This commit is contained in:
parent
e5296b3892
commit
d9fb844dc8
9
main.go
9
main.go
@ -135,6 +135,15 @@ func main() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
r.GET("/:title/*option", func(c *gin.Context) {
|
||||||
|
title := c.Param("title")
|
||||||
|
option := c.Param("option")
|
||||||
|
fmt.Println(title, "["+option+"]")
|
||||||
|
if option == "/view" {
|
||||||
|
} else {
|
||||||
|
c.Redirect(302, "/"+title)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
r.Run(":12312")
|
r.Run(":12312")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user