Skip to content

furdarius/subswitch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Furdarius\subswitch

Build Status Coverage Status Go Report Card

Want to serve static from static.domain.io without nginx or apache? You wanna separate backend api on api.domain.io? Just do it with this library!

It works like simple middleware, so you can inject it in your app incredibly fast.

Installation

With a properly configured Go toolchain:

go get github.com/furdarius/subswitch

Usage

// .. router init ..

// Let's serve static from domain.io
// and REST api from api.domain.io
ss := subswitch.New(http.FileServer(http.Dir("/tmp")), map[string]http.Handler{
    "api": router,
})

// Use it like http.Handler
http.ListenAndServe(":8080", ss)

About

Library makes it easy to set separate handlers for subdomains

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages