custom

command
v0.0.0-...-d8853ad Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

README

Custom Router

This entrypoint serve as an example about how to build your own custom Cosmo Router. The main.go file is the entrypoint of the router and is responsible for starting the router. You can see we will load the default Router and your custom module.

package main

import (
	routercmd "github.com/wundergraph/cosmo/router/cmd"
	// Import your modules here
	_ "github.com/wundergraph/cosmo/router/cmd/custom/module"
)

func main() {
	routercmd.Main()
}

Run the Router

Before you can run the router, you need to copy the .env.example to .env and adjust the values.

go run ./cmd/custom/main.go

Build your own Router

go build -o router ./cmd/custom/main.go

Build your own Image

docker build -f custom.Dockerfile -t router-custom:latest .

Run tests

Tests for this module can be found within the integration tests.

All commands are run from the root of the router directory.

Credits

The module system is inspired by Caddy.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL