webik

package module
v0.0.0-...-40b3c1b Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: MIT Imports: 9 Imported by: 0

README

Webik

Webik - Micro web server for running Frontend application locally based on Angular, Vue, React, etc.

  • Handling HTTP GET "/" "" for index.html

  • Processing GET for files with extensions: css, html, js, etc

  • Create reverse proxy for the backend

License:

Mit license

Example
package main

import (
	"github/aas-spec/webik"
	"flag"
	"log"
)

var serverPort = flag.String("serverPort", ":5050", "Server Port")
var sitePath = flag.String("sitePath", "./site", "Site Path")
var sourceRoute = flag.String("sourceRoute", "", "Source Api Route")
var targetRoute = flag.String("targetRoute", "", "Target Api Route")


func main() {
	flag.Parse()
	log.Print("Mini web server, Webik 2021")
	log.Printf("Site Path: %s", *sitePath)
	if *sourceRoute != "" {
		log.Printf("Source Route: %s, Target Route: %s", *sourceRoute, *targetRoute)
	}
	webik.ListenAndServe(*serverPort, *sitePath, *targetRoute, *sourceRoute)
}
Command Line Arguments

Usage: weserver --serverPort=:5050 --sitePath=./mysappite --sourceRoute=/api --targetRoute=http:/127.0.0.1:5555/api

serverPort - WebServer Port

sitePath - The path to the web application on your hard drive

sourceRoute - The part of API url as Frontend knows it

targetRoute - The initial part of Api url

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenAndServe

func ListenAndServe(Port string, SitePath string, TargetApiRoute string, SourceApiRoute string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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