Vroomy is a plugin-based server. Vroomy can be used for anything, from a static file server to a full-blown back-end service!
To add vroomy
to your Go project, just call:
go get github.com/vroomy/vroomy
port = 8080
tlsPort = 10443
tlsDir = "./tls"
[env]
fqdn = "https://myserver.org"
[[route]]
httpPath = "/"
target = "./public_html/index.html"
[[route]]
httpPath = "/js/*"
target = "./public_html/js"
[[route]]
httpPath = "/css/*"
target = "./public_html/css"
Note: Please see config.example.toml for a more in depth example
Getting started with vroomy
is quite easy! Call vroomy.New
with the location of your configuration file. For a more in-depth explanation, please check out our hello-world repository.
package main
import (
"context"
"log"
"github.com/vroomy/vroomy"
_ "github.com/vroomy/hello-world/plugins/companies"
)
func main() {
var (
svc *vroomy.Vroomy
err error
)
if svc, err = vroomy.New("./config.toml"); err != nil {
log.Fatal(err)
}
if err = svc.ListenUntilSignal(context.Background()); err != nil {
log.Fatal(err)
}
}
func ExampleEnvironment_Get() {
val := exampleEnvironment.Get("foo")
fmt.Println("Value of foo is", val)
}
func ExampleEnvironment_GetInt() {
var (
val int
err error
)
if val, err = exampleEnvironment.GetInt("foo"); err != nil {
// Handle error here
return
}
fmt.Println("Value of foo is", val)
}
func ExampleEnvironment_GetInt64() {
var (
val int64
err error
)
if val, err = exampleEnvironment.GetInt64("foo"); err != nil {
// Handle error here
return
}
fmt.Println("Value of foo is", val)
}
func ExampleEnvironment_GetFloat64() {
var (
val float64
err error
)
if val, err = exampleEnvironment.GetFloat64("foo"); err != nil {
// Handle error here
return
}
fmt.Println("Value of foo is", val)
}
func ExampleEnvironment_GetTime() {
var (
val time.Time
err error
)
if val, err = exampleEnvironment.GetTime("foo", "2006-01-02"); err != nil {
// Handle error here
return
}
fmt.Println("Value of foo is", val)
}
func ExampleEnvironment_GetTimeInLocation() {
var (
val time.Time
err error
)
if val, err = exampleEnvironment.GetTimeInLocation("foo", "2006-01-02", time.Local); err != nil {
// Handle error here
return
}
fmt.Println("Value of foo is", val)
}
func ExampleEnvironment_Must() {
var (
val string
err error
)
if val, err = exampleEnvironment.Must("foo"); err != nil {
// Handle error here
return
}
fmt.Println("Value of foo is", val)
}
func ExampleEnvironment_MustInt() {
var (
val int
err error
)
if val, err = exampleEnvironment.MustInt("foo"); err != nil {
// Handle error here
return
}
fmt.Println("Value of foo is", val)
}
func ExampleEnvironment_MustInt64() {
var (
val int64
err error
)
if val, err = exampleEnvironment.MustInt64("foo"); err != nil {
// Handle error here
return
}
fmt.Println("Value of foo is", val)
}
func ExampleEnvironment_MustFloat64() {
var (
val float64
err error
)
if val, err = exampleEnvironment.MustFloat64("foo"); err != nil {
// Handle error here
return
}
fmt.Println("Value of foo is", val)
}
func ExampleEnvironment_MustTime() {
var (
val time.Time
err error
)
if val, err = exampleEnvironment.MustTime("foo", "2006-01-02"); err != nil {
// Handle error here
return
}
fmt.Println("Value of foo is", val)
}
func ExampleEnvironment_MustTimeInLocation() {
var (
val time.Time
err error
)
if val, err = exampleEnvironment.MustTimeInLocation("foo", "2006-01-02", time.Local); err != nil {
// Handle error here
return
}
fmt.Println("Value of foo is", val)
}
:: Initializes backends in provided directory.
Overrides value set in config and default values.
Ignored when testing in favor of dir "testData".
Use vroomy -d <dir>
Thanks goes to these wonderful people (emoji key):
Josh π» π |
Derek Halman π» |
Matt Stay π¨ |
This project follows the all-contributors specification. Contributions of any kind welcome!