web-serve

command module
v0.0.0-...-bd2cb35 Latest Latest
Warning

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

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

README

Web-Serve

image

Procedure

  • Generate your production build through npm run build (for eg.) or any appropiate way.
  • Place the build directory inside html directory replacing the existing one.
  • Update the configuration in conf.yml if required. The YAML is self explanatory.
  • Build the binary.
# Required go version 1.16 or higher
export GO111MODULE=on
go build -o <output binary name> main.go
  • Run the binary by ./<binary_name>
Build the Binary using Docker

Now no hassle of installing dependencies to build the binary. FYI, I can't provide ready to use built binary for diferrent platforms as the web build assets is going to be embedded into the binary during compile time.

But be assured, i have provided a very easy way to resolve the issue. Just run these commands,

# build the docker image
docker build -t web-serve . 

# Running the build
docker run -v $(pwd):/web-serve -e OS="linux" -e ARCH="amd64" -e BIN_NAME="your binary name" web-serve

# Change ownership of the binary directory from root to host user
sudo chown -R $(id -u) binary

As binaries are platform dependent, you have to mention the Operating system and processor instruction Architecture via environment variables OS and ARCH respectively. A binary will be created at binary/ dorectory of current working directory. The environment variable BIN_NAME (Optional) is the name of the output binary.

A list of supported OS and Architecture has been made available here. Just replace it with the environment variable OS and ARCH during docker run.

Supported Commands

./<binary_name> help

web-serve - A lightweight production build webapp server

Usage:
  web-serve [commands] [flags]
  web-serve [command]

Available Commands:
  help        Help about any command
  install     install server as a os service
  remove      remove/uninstall the service related to the server
  start       start the server
  status      server current status running/stopped
  stop        stop the server

Flags:
  -h, --help   help for web-serve

Use "web-serve [command] --help" for more information about a command.

Output

image

Contribute & Bug Report

If you find a bug in web-serve or have any questions you can ask here.

New Contributions are always welcome. Please discuss bugfix, performance improvements, new feature request before opening a PR.

Documentation

Overview

* Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Directories

Path Synopsis
Package core * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
Package core * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.

Jump to

Keyboard shortcuts

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