I wrote my first Go application with Martini. I have route with named parameter:
m := martini.Classic()
staticOptions := martini.StaticOptions{Prefix: "assets"}
m.Use(martini.Static("assets", staticOptions))
m.Get("/edit/:id", editHandler)
m.Run()
The editHandler renders edit template with bootstrap stylesheet and script which lie in assets/css
and assets/js
folders accordingly.
<link rel="stylesheet" type="text/css" href="assets/css/bootstrap.min.css">
<script type="text/javascript" src="assets/js/bootstrap.min.js"></script>
But when I open edit page in my browser my static files don't load, because browser makes requests to edit/assets/css/bootstrap.min.css
and edit/assets/js/bootstrap.min.js
.
How can I strip any route prefix?('edit', 'show' and others)