apiDocSrvc - Provide embeded doc server

apiDocSrvc

Provide embeded doc server

Attribution

Forked from https://github.com/flowchartsman/swaggerui
Modified swaggerui.go to support gorilla mux.
Moved all handler code from main to the module.

Updated the embedded swaggerui code

Clone the code and go run generate.go
This will update the embed directory with the latest swaggerui code.
Push the results back to the repository.

Installing

go get "github.com/tom342178/swaggerui"

Example usage

package main

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

	"github.com/tom342178/swaggerui"
)

//go:embed app-api-spec.yaml
var spec []byte

func main() {

// If using the openApi generate=, the following code is 
// generated in the routes.go file and will have been called already.

router := mux.NewRouter().StrictSlash(true)

// The following calls out to a module that addes a fileserver
// and therefore must be placed after all other paths are declared. 

apiDocSrvc.apiDoc(spec, *router)

log.Fatal(http.ListenAndServe(":8080", router))  
  
}  
Similar Resources

Cert bound sts server - Certificate Bound Tokens using Security Token Exchange Server (STS)

Cert bound sts server - Certificate Bound Tokens using Security Token Exchange Server (STS)

Certificate Bound Tokens using Security Token Exchange Server (STS) Sample demonstration of Certificate Bound Tokens acquired from a Security Token Ex

Jan 2, 2022

Echo-server - An HTTP echo server designed for testing applications and proxies

echo-server An HTTP echo server designed for testing applications and proxies. R

Dec 20, 2022

Broadcast-server - A simple Go server that broadcasts any data/stream

broadcast A simple Go server that broadcasts any data/stream usage data You can

Oct 21, 2022

Videos2gether-server - Server for the Realtime video streaming app Videos2Gether

Videos Together server Server source code for the https://videos2gether.com Arch

Jan 9, 2022

JPRQ Customizer is a customizer that helps to use the JPRQ server code and make it compatible with your own server with custom subdomain and domain

JPRQ Customizer is a customizer that helps to use the JPRQ server code and make it compatible with your own server with custom subdomain and domain

JPRQ Customizer is a customizer that helps to use the JPRQ server code and make it compatible with your own server with custom subdomain and domain.You can upload the generated directory to your web server and expose user localhost to public internet. You can use this to make your local machine a command center for your ethical hacking purpose ;)

Jan 19, 2022

Envoy-eds-server - Envoy EDS server is a working Envoy Discovery Service implementation

envoy-eds-server Intro Envoy EDS server is a working Envoy Discovery Service imp

Apr 2, 2022

Http-server - A HTTP server and can be accessed via TLS and non-TLS mode

Application server.go runs a HTTP/HTTPS server on the port 9090. It gives you 4

Feb 3, 2022

Server - Dupman server written in Go

server dupman server written in Go Requirements Go (=1.17) Installation Usage C

Feb 22, 2022

“Dear Port80” is a zero-config TCP proxy server that hides SSH connection behind a HTTP server!

Dear Port80 About The Project: “Dear Port80” is a zero-config TCP proxy server that hides SSH connection behind a HTTP server! +---------------------

Jun 29, 2022
Comments
  • getting error from go mod tidy

    getting error from go mod tidy

    go: finding module for package github.com/tom342178/apiDocSrvc github.com/GIT_USER_ID/GIT_REPO_ID imports github.com/tom342178/apiDocSrvc: module github.com/tom342178/apiDocSrvc@latest found (v0.0.0-20211030043113-c2a5594ec747), but does not contain package github.com/tom342178/apiDocSrvc

Related tags
WebTransport implementation based on quic-go (https://datatracker.ietf.org/doc/draft-ietf-webtrans-http3/)

webtransport-go webtransport-go is an implementation of the WebTransport protocol, based on quic-go. It currently implements draft-02 of the specifica

Dec 31, 2022
Package socket provides a low-level network connection type which integrates with Go's runtime network poller to provide asynchronous I/O and deadline support. MIT Licensed.

socket Package socket provides a low-level network connection type which integrates with Go's runtime network poller to provide asynchronous I/O and d

Dec 14, 2022
A REST API for the DN42 registry, written in Go, to provide a bridge between interactive applications and the registry.

dn42regsrv A REST API for the DN42 registry, written in Go, to provide a bridge between interactive applications and registry data. A public instance

Apr 21, 2022
Provide cloud-edge message synergy solutions for companies and individuals.the cloud-edge message system based on NATS.

Swarm This project is a cloud-edge synergy solution based on NATS. quikly deploy cloud deploy on k8s #pull the project. git clone https://github.com/g

Jan 11, 2022
Responsible for provide data to the web front-end

Responsible for provide data to the web front-end. Generates names based on preseted datasets (list of example names), but you can upload a custom dataset (it must have at least 23 names)

Sep 3, 2022
A Language Server Protocol (LSP) server for Jsonnet

Jsonnet Language Server Warning: This project is in active development and is likely very buggy. A Language Server Protocol (LSP) server for Jsonnet.

Nov 22, 2022
The server-pubsub is the main backend of DATAVOC project that manages all the other web-server modules of the same project such as the processor

server-pubsub The server-pubsub is the main backend of DATAVOC project that manages all the other web-server modules of the same project such as the p

Dec 3, 2021
server-to-server sync application, written in go/golang.

svcpy: server to server copy a basic server-to-server copy application. on a single binary, it can be a server or a client. example usage: on the serv

Nov 4, 2021
Server and client implementation of the grpc go libraries to perform unary, client streaming, server streaming and full duplex RPCs from gRPC go introduction

Description This is an implementation of a gRPC client and server that provides route guidance from gRPC Basics: Go tutorial. It demonstrates how to u

Nov 24, 2021
Pape-server - A small server written in golang to serve a random wallpaper.

pape-server I like to inject custom CSS themes into a lot of websites and electron apps, however browsers don't let websites access local disk through

Dec 31, 2021