Skip to content

mark-adams/go-swagger-ui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Swagger UI

Build Status Documentation

This package provides a simple handler for rendering the Swagger UI in a Go application

Example

package main

import (
	"net/http"

	"github.com/mark-adams/go-swagger-ui"
)

func main() {
	// Swagger UI using the latest JS / CSS from unpkg and loading the spec from /swagger.json
	http.Handle("/docs", swaggerui.Handler())

	// Swagger UI using a custom title, spec URL, and version of Swagger UI
	http.Handle("/docs-petstore", swaggerui.CustomHandler(
		"API Documentation", "http://petstore.swagger.io/v2/swagger.json", "latest",
	))

	http.ListenAndServe(":8080", nil)
}

About

A simple http.Handler for showing the Swagger UI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages