server

package
v0.2.11 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &cli.Command{
	Name:  "server",
	Usage: "start Web server",

	Category: utility.Category,

	Flags: []cli.Flag{
		app.PortFlag(""),

		&cli.BoolFlag{
			Name:  "spa",
			Usage: "enable SPA redirect",
		},

		&cli.StringFlag{
			Name:  "index",
			Usage: "index file name",
			Value: "index.html",
		},
	},

	Action: func(ctx context.Context, cmd *cli.Command) error {
		port := app.MustPortOrRandom(ctx, cmd, "", 3000)

		spa := cmd.Bool("spa")
		index := cmd.String("index")

		if index == "" {
			index = "index.html"
		}

		return startWebServer(ctx, port, index, spa)
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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