
Research
/Security News
Shai Hulud Strikes Again (v2)
Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected.
Library to display Swagger documentation in HTML format
go get github.com/werpas/ui-swagger
A valid Swagger document with a filename of swagger.json should exists under the api folder.
<GO project root>/api/swagger.json
To use Swagger UI, just pass MUX router and the API's base path.
Code:
package server
import (
"log"
"net/http"
"github.com/gorilla/mux"
sw "github.com/werpas/ui-swagger"
)
const base_path = "/api/v1/"
func SetupRestServer() {
// Register a handler for each route pattern
router := mux.NewRouter()
// attach the swagger routes
sw.AttachSwaggerUI(router, base_path)
// start listening on the configured port and routes
log.Fatal(http.ListenAndServe(":8080", router))
}
##How to view To view the swagger HTML endpoint, go to the following URL format.
<host url>/<base api path>/help
##Available Function
func AttachSwaggerUI (router *mux.Router, base_path string) (err error)
Sets the routes for the static page and the swagger document file. `
FAQs
Unknown package
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.