go-micro.dev/v5@v5.12.0/cmd/micro/web/templates/api.html (about) 1 {{define "content"}} 2 <h2 class="text-2xl font-bold mb-4">API</h2> 3 <p class="api-auth-info" style="background:#f8f8e8; border:1px solid #e0e0b0; padding:1em; margin-bottom:2em; font-size:1.08em; border-radius:6px;"> 4 <b>API Authentication Required:</b> All API calls to <code>/api/...</code> endpoints (except this page) must include an <b>Authorization: Bearer <token></b> header.<br> 5 You can generate tokens on the <a href="/auth/tokens">Tokens page</a>. 6 </p> 7 {{range .Services}} 8 <h3 id="{{.Anchor}}" style="margin-top:3em; font-size:1.2em; font-weight:bold;">{{.Name}}</h3> 9 {{if .Endpoints}} 10 <div style="margin-bottom:3em;"> 11 {{range .Endpoints}} 12 <div style="margin-bottom:2.8em; padding:1.3em 1.5em; background:#fafbfc; border-radius:7px; border:1px solid #eee;"> 13 <div style="font-size:1.12em; margin-bottom:0.7em;"><a href="{{.Path}}" class="micro-link" style="font-weight:bold;">{{.Name}}</a></div> 14 <div style="margin-bottom:0.8em; color:#888; font-size:1em;"> 15 <b>HTTP Path:</b> <code>{{.Path}}</code> 16 </div> 17 <div style="display:flex; gap:3em; flex-wrap:wrap;"> 18 <div style="min-width:240px;"> 19 <b>Request:</b> 20 <pre style="background:#f4f4f4; border-radius:5px; padding:1em 1.2em; margin:0.5em 0 1em 0; font-size:1em;">{{.Params}}</pre> 21 </div> 22 <div style="min-width:240px;"> 23 <b>Response:</b> 24 <pre style="background:#f4f4f4; border-radius:5px; padding:1em 1.2em; margin:0.5em 0 1em 0; font-size:1em;">{{.Response}}</pre> 25 </div> 26 </div> 27 </div> 28 {{end}} 29 </div> 30 {{else}} 31 <p style="color:#888;">No endpoints</p> 32 {{end}} 33 {{end}} 34 {{end}}