jsenv

package
v0.0.0-...-5274ca3 Latest Latest
Warning

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

Go to latest
Published: May 22, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	WindowVarName: "_jsenv",
	EnvPrefixes:   []string{"REACT_APP_", "NODE_", "HEROKU_"},
	Indent:        "  ",
}

Functions

func InstallAt

func InstallAt(indexPath string, cfg Config) error

InstallAt reads the file at indexPath, and overwrites it with an index.html with config. See README for more info.

Types

type Config

type Config struct {
	// The name of the environment variable on the window.
	// Default: _jsenv
	WindowVarName string
	// Prefixes of environment variables to render into the window config.
	// Default: REACT_APP_, NODE_, HEROKU_
	EnvPrefixes []string
	// Indentation of each entry in the config dict, because beauty is important
	// and who knows how your index.html is intented.
	// Default: "  " (two spaces)
	Indent string
}

Jump to

Keyboard shortcuts

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