You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to serve static assets like the one given in the example code. The path based approach doesn't seem to support any depth.
/static/index.html works but /static/js/main.js doesn't work.
The text was updated successfully, but these errors were encountered:
That depends on the Router used and the Route specification.
Using the default RouterJS311, you have to define multiple routes to the same handler function. Have a look at RegisterSwaggerService in the swagger package.
However, using the improved and recommended CurlyRouter, you can use a wildcard expression in the Route such as:
"/static/{subpath:*}"
And in your Route function:
subpath := r.PathParameter("subpath")
I will add an extra example in the project that demonstrates this.
When trying to serve static assets like the one given in the example code. The path based approach doesn't seem to support any depth.
/static/index.html works but /static/js/main.js doesn't work.
The text was updated successfully, but these errors were encountered: