Embedded, self-hosted swagger-ui for go servers

swaggerui

Embedded, self-hosted Swagger Ui for go servers

This module provides swaggerui.Handler, which you can use to serve an embedded copy of Swagger UI as well as an embedded specification for your API.

NOTE

This module depends on the embed package provided by the upcoming go 1.16 release, so it depends on having at least go 1.16 and, until that release lands, this project should be considered experimental. Once 1.16 lands, the repository will be version tagged to the latest major release of Swagger UI, using the included generate.go to keep up with future releases as necessary for tracking changes.

Example usage

package main

import (
	_ "embed"
	"log"
	"net/http"

	"github.com/flowchartsman/swaggerui"
)

//go:embed swagger.json
var spec []byte

func main() {
	log.SetFlags(0)
	http.Handle("/swagger/", http.StripPrefix("/swagger", swaggerui.Handler(spec, swaggerui.SpecTypeJSON)))
	log.Println("serving on :8080")
	log.Fatal(http.ListenAndServe(":8080", nil))
}
Similar Resources

The fastest way to create self-hosted exit-servers

The fastest way to create self-hosted exit-servers

inletsctl - the fastest way to create self-hosted exit-servers inletsctl automates the task of creating an exit-server (tunnel server) on public cloud

Dec 15, 2022

Swagger + Gin = SwaGin, a web framework based on Gin and Swagger

Swagger + Gin = SwaGin, a web framework based on Gin and Swagger

Swagger + Gin = SwaGin Introduction SwaGin is a web framework based on Gin and Swagger, which wraps Gin and provides built-in swagger api docs and req

Dec 30, 2022

Swagger + Gin = SwaGin, a web framework based on Gin and Swagger

Swagger + Gin = SwaGin, a web framework based on Gin and Swagger

Swagger + Gin = SwaGin Introduction SwaGin is a web framework based on Gin and Swagger, which wraps Gin and provides built-in swagger api docs and req

Dec 30, 2022

Swagger-go-chi - Generate a go-chi server from swagger

swagger-go-chi Install go install github.com/cugu/swagger-go-chi@main Run swagge

Nov 5, 2022

Swagger builder and input validation for Go servers

Swagger builder and input validation for Go servers

crud A Swagger/OpenAPI builder and validation library for building HTTP/REST APIs. Heavily inspired by hapi and the hapi-swagger projects. No addition

Jan 5, 2023

Selenium Hub successor running browsers within containers. Scalable, immutable, self hosted Selenium-Grid on any platform with single binary.

Selenium Hub successor running browsers within containers. Scalable, immutable, self hosted Selenium-Grid on any platform with single binary.

Selenoid Selenoid is a powerful implementation of Selenium hub using Docker containers to launch browsers. Features One-command Installation Start bro

Jan 5, 2023

Git with a cup of tea, painless self-hosted git service

Git with a cup of tea, painless self-hosted git service

Gitea - Git with a cup of tea View the chinese version of this document Purpose The goal of this project is to make the easiest, fastest, and most pai

Jan 2, 2023

Git with a cup of tea, painless self-hosted git service

Git with a cup of tea, painless self-hosted git service

Gitea - Git with a cup of tea View the chinese version of this document Purpose The goal of this project is to make the easiest, fastest, and most pai

Jan 2, 2023

Remark42 is a self-hosted, lightweight, and simple comment engine

Remark42 is a self-hosted, lightweight, and simple comment engine

Remark42 is a self-hosted, lightweight, and simple (yet functional) comment engine, which doesn't spy on users. It can be embedded into blogs, articles or any other place where readers add comments.

Dec 28, 2022

Distributed, lock-free, self-hosted health checks and status pages

Distributed, lock-free, self-hosted health checks and status pages

Checkup is distributed, lock-free, self-hosted health checks and status pages, written in Go. It features an elegant, minimalistic CLI and an idiomati

Dec 30, 2022

EggContractor is a self-hosted contract monitoring web app + CLI client for Egg

EggContractor is a self-hosted contract monitoring web app + CLI client for Egg, Inc.. It allows you to easily monitor all your contract progress, as well as peeking into prospective coops you may want to join.

Nov 23, 2022

TeslaMateApi is a RESTful API to get data collected by self-hosted data logger TeslaMate in JSON

TeslaMateApi is a RESTful API to get data collected by self-hosted data logger TeslaMate in JSON.

Dec 10, 2022

✒ A self-hosted, cross-platform service to sign iOS apps using any CI as a builder

✒ A self-hosted, cross-platform service to sign iOS apps using any CI as a builder

iOS Signer Service A self-hosted, cross-platform service to sign iOS apps using any CI as a builder Introduction There are many reasons to install app

Jan 7, 2023

Self hosted live chat server written in Go

goch is a self-hosted live-chat server written in Go. It allows you to run a live-chat software on your own infrastructure. You can create multip

Dec 11, 2022

High performance, self-hosted newsletter and mailing list manager with a modern dashboard. Single binary app.

High performance, self-hosted newsletter and mailing list manager with a modern dashboard. Single binary app.

listmonk is a standalone, self-hosted, newsletter and mailing list manager. It is fast, feature-rich, and packed into a single binary. It uses a Postg

Dec 30, 2022

📕 twtxt is a Self-Hosted, Twitter™-like Decentralised microBlogging platform. No ads, no tracking, your content, your data!

📕 twtxt is a Self-Hosted, Twitter™-like Decentralised microBlogging platform. No ads, no tracking, your content, your data!

twtxt 📕 twtxt is a Self-Hosted, Twitter™-like Decentralised micro-Blogging platform. No ads, no tracking, your content, your data! Technically twtxt

Jul 26, 2021

Gogs is a painless self-hosted Git service

Gogs is a painless self-hosted Git service

Gogs - A painless self-hosted Git service 简体中文 🔮 Vision The Gogs (/gɑgz/) project aims to build a simple, stable and extensible self-hosted Git servi

Jan 9, 2023

Git with a cup of tea, painless self-hosted git service

Git with a cup of tea, painless self-hosted git service

Gitea - Git with a cup of tea View the chinese version of this document Purpose The goal of this project is to make the easiest, fastest, and most pai

Jan 2, 2023

Universal code search (self-hosted)

Universal code search (self-hosted)

Sourcegraph OSS edition is a fast, open-source, fully-featured code search and navigation engine. Enterprise editions are available. Features Fast glo

Jan 9, 2023
Comments
  • chi-router doesnt seem to work well with swaggerui

    chi-router doesnt seem to work well with swaggerui

    Issue

    it looks like when using swaggerui with go-chi router module, the http request fails to find the embedded CSS files and resources.

    Screen Shot 2022-01-31 at 9 47 25

    Snippet

    import github.com/go-chi/chi
    r := chi.NewRouter()
    r.Handle("/swagger/", http.StripPrefix("/swagger", swaggerui.Handler(spec)))
    

    Additional Info

    go 1.17 github.com/go-chi/chi/v5 v5.0.7

  • github actions to publish changes to swagger-ui to a bleed branch.

    github actions to publish changes to swagger-ui to a bleed branch.

    The go generate code has been adapted for the current version of swagger-ui, which more or less amounted to pointing it at a different file, so it should remain stable enough to run against new releases unless they decide to switch something around again. There's no guarantee it will work every time, but for those who want to try it out, it would be better to have some kind of job to do the chore stuff for me and allow people to use newer versions more quickly.

  • Allow UI Customization

    Allow UI Customization

    It would be nice if the user could customize certain aspects of their UI, either via CSS or turning on/off certain swagger-ui features. Of course, the more things that get templatized means the more potentially fragile the generate code to keep the static files up to date becomes, so this will need to be done carefully, and each one will probably need to get hooked into the CI system to surface any potentially-breaking changes from upstream.

    • [ ] Prebuild some new layouts and themes
    • [ ] Templatize swagger-initializer.js rather than swapping out the values (plugins/layouts)
    • [ ] Templatize .css
Self hosted search engine for data leaks and password dumps
Self hosted search engine for data leaks and password dumps

Self hosted search engine for data leaks and password dumps. Upload and parse multiple files, then quickly search through all stored items with the power of Elasticsearch.

Aug 2, 2021
Listmonk - a standalone, self-hosted, newsletter and mailing list manager
Listmonk - a standalone, self-hosted, newsletter and mailing list manager

listmonk is a standalone, self-hosted, newsletter and mailing list manager. It is fast, feature-rich, and packed into a single binary. It uses a Postg

Jan 13, 2022
Swagger 2.0 implementation for go

Swagger 2.0 This package contains a golang implementation of Swagger 2.0 (aka OpenAPI 2.0): it knows how to serialize and deserialize swagger specific

Dec 30, 2022
F' - A flight software and embedded systems framework

F´ (F Prime) is a component-driven framework that enables rapid development and deployment of spaceflight and other embedded software applications.

Jan 4, 2023
A BPMN engine, meant to be embedded in Go applications with minim hurdles, and a pleasant developer experience using it.

A BPMN engine, meant to be embedded in Go applications with minim hurdles, and a pleasant developer experience using it. This approach can increase transparency for non-developers.

Dec 29, 2022
Embedded javascript server-side renderer for Golang

v8ssr Embedded javascript server-side renderer for Golang. Useful for static server-side rendering. This does not attempt to polyfill node or browser

Aug 27, 2022
Host yo' self from your browser, your phone, your toaster.
Host yo' self from your browser, your phone, your toaster.

A hosting service from the browser, because why not. Try it at hostyoself.com. See it in action Here's an example where I use hostyoself.com to host i

Jan 1, 2023
Enable your Golang applications to self update with S3

s3update Enable your Golang applications to self update with S3. Requires Go 1.8+ This package enables our internal tools to be updated when new commi

Jul 20, 2022
A framework for constructing self-spreading binaries
A framework for constructing self-spreading binaries

A framework that aids in creation of self-spreading software Requirements go get -u github.com/redcode-labs/Coldfire go get -u github.com/yelinaung/go

Jan 2, 2023
GoatCounter is an open source web analytics platform available as a hosted service or self-hosted app

GoatCounter is an open source web analytics platform available as a hosted service (free for non-commercial use) or self-hosted app. It aims to offer easy to use and meaningful privacy-friendly web analytics as an alternative to Google Analytics or Matomo.

Dec 29, 2022