web

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

README

Launchr Web plugin

Launchr Web plugin is an extenstion to Launchr to run actions via Web UI. The plugin consists of a Backend API and a Frontend client.

Table of contents

Usage

Build launchr from source locally. Build dependencies:

  1. go >=1.21, see installation guide
  2. nodejs 20, see NVM or Volta
  3. make

Build the launchr tool:

make
bin/launchr web --help

The documentation for launchr usage can be found in the main project.

To build the client:

Node
cd client
# Install yarn 4 https://yarnpkg.com/getting-started/install yarn set version stable

# Fetch dependencies
yarn
# Build the project
yarn build
# Start client dev server
yarn dev
Docker
make front-install front-build

See client readme for more information.

To run Launchr Web server:

# Run web server on http://localhost:8080
bin/launchr web
# Run web server on http://localhost:3000
bin/launchr web -p 3000
# Serve swagger-ui and swagger.json
# Paths /api/swagger.json and /api/swagger-ui
bin/launchr web --swagger-ui
# To proxy requests to client dev server
bin/launchr web --swagger-ui --proxy-client=http://localhost:5173/

By default, Launchr HTTP server provides client files from client/dist. But as shown above, launchr may be a reverse proxy server for yarn dev with --proxy-client flag.

If you face any issues with launchr:

  1. Open an issue in the repo.
  2. Share the app version with launchr --version

Development

The launchr can be built with a make to bin directory:

make

It is also supported to make a build to use with dlv for debug:

make DEBUG=1

Useful make commands:

  1. Fetch dependencies - make deps
  2. Test the code - make test
  3. Lint the code - make lint

Test for release

make front-install front-build
make EMBED=1

Documentation

Overview

Package web provides a launchr plugin with Web UI for launchr.

Index

Constants

View Source
const APIPrefix = "/api"

APIPrefix is a default api prefix on the server.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

Plugin is launchr plugin providing web ui.

func (*Plugin) CobraAddCommands

func (p *Plugin) CobraAddCommands(rootCmd *cobra.Command) error

CobraAddCommands implements launchr.CobraPlugin interface to provide web functionality.

func (*Plugin) OnAppInit

func (p *Plugin) OnAppInit(app launchr.App) error

OnAppInit implements launchr.Plugin interface.

func (*Plugin) PluginInfo

func (p *Plugin) PluginInfo() launchr.PluginInfo

PluginInfo implements launchr.Plugin interface.

Directories

Path Synopsis
cmd
launchr
Package executes Launchr application.
Package executes Launchr application.
Package server provides primitives to interact with the openapi HTTP API.
Package server provides primitives to interact with the openapi HTTP API.

Jump to

Keyboard shortcuts

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