serve alternatives and similar packages
Based on the "Utilities" category.
Alternatively, view serve alternatives based on common mentions on social networks and blogs.
-
项目文档
基于vite+vue3+gin搭建的开发基础平台(支持TS,JS混用),集成jwt鉴权,权限管理,动态路由,显隐可控组件,分页封装,多点登录拦截,资源权限,上传下载,代码生成器,表单生成器,chatGPT自动查表等开发必备功能。 -
excelize
Go language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets -
xlsx
(No longer maintained!) Go (golang) library for reading and writing XLSX files. -
godotenv
A Go port of Ruby's dotenv library (Loads environment variables from .env files) -
hystrix-go
Netflix's Hystrix latency and fault tolerance library, for Go -
go-funk
A modern Go utility library which provides helpers (map, find, contains, filter, ...) -
gorequest
GoRequest -- Simplified HTTP client ( inspired by nodejs SuperAgent ) -
goreporter
A Golang tool that does static analysis, unit testing, code review and generate code quality report. -
Kopia
Cross-platform backup tool for Windows, macOS & Linux with fast, incremental backups, client-side end-to-end encryption, compression and data deduplication. CLI and GUI included. -
gojson
Automatically generate Go (golang) struct definitions from example JSON -
lancet
A comprehensive, efficient, and reusable util function library of go. -
create-go-app
✨ Create a new production-ready project with backend, frontend and deploy automation by running one CLI command! -
spinner
Go (golang) package with 90 configurable terminal spinner/progress indicators. -
filetype
Fast, dependency-free Go package to infer binary file types based on the magic numbers header signature -
EaseProbe
A simple, standalone, and lightweight tool that can do health/status checking, written in Go. -
boilr
:zap: boilerplate template manager that generates files or directories from template repositories -
mole
CLI application to create ssh tunnels focused on resiliency and user experience. -
beaver
💨 A real time messaging system to build a scalable in-app notifications, multiplayer games, chat apps in web and mobile apps. -
go-underscore
Helpfully Functional Go - A useful collection of Go utilities. Designed for programmer happiness. -
mimetype
A fast Golang library for media type and file extension detection, based on magic numbers -
JobRunner
Framework for performing work asynchronously, outside of the request flow -
git-time-metric
Simple, seamless, lightweight time tracking for Git
Static code analysis for 29 languages.
Do you think we are missing an alternative of serve or a related project?
Popular Comparisons
README
serve
is a static http server anywhere you need one.
TL;DR
It's basically
python -m SimpleHTTPServer 8080
written in Go, because who can remember that many letters?
Features
- HTTPS (TLS)
- CORS support
- Request logging
net/http
compatible
Installation
serve
can be installed in a handful of ways:
Homebrew on macOS
If you are using Homebrew on macOS, you can install serve
with the
following command:
brew install syntaqx/tap/serve
Docker
The official syntaqx/serve image is available on Docker Hub.
To get started, try hosting a directory from your docker host:
docker run -v .:/var/www:ro -d syntaqx/serve
Alternatively, a simple Dockerfile
can be used to generate a new image that
includes the necessary content:
FROM syntaqx/serve
COPY . /var/www
Place this in the same directory as your content, then build
and run
the
container:
docker build -t some-content-serve .
docker run --name some-serve -d some-content-serve
Exposing an external port
docker run --name some-serve -d -p 8080:8080 some-content-serve
Then you can navigate to http://localhost:8080/ or http://host-ip:8080/ in your browser.
Using environment variables for configuration
Currently, serve
only supports using the PORT
environment variable for
setting the listening port. All other configurations are available as CLI flags.
In future releases, most configurations will be settable from both the CLI flag as well as a compatible environment variable, aligning with the expectations of a 12factor app. But, that will require a fair amount of work before the functionality is made available.
Here's an example using docker-compose.yml
to configure serve
to use HTTPS:
version: '3'
services:
web:
image: syntaqx/serve
volumes:
- ./static:/var/www
- ./fixtures:/etc/ssl
environment:
- PORT=1234
ports:
- 1234
command: serve -ssl -cert=/etc/ssl/cert.pem -key=/etc/ssl/key.pem -dir=/var/www
The project repository provides an example [docker-compose](./docker-compose.yml)
that implements a variety of common use-cases for serve
. Feel free to use
those to help you get started.
Download the binary
Quickly download install the latest release:
curl -sfL https://install.goreleaser.com/github.com/syntaqx/serve.sh | sh
Or manually download the latest release binary for your system and
architecture and install it into your $PATH
.
From source
To build from source, check out the instructions on getting started with development.
Usage
serve [options] [path]
[path]
defaults to.
(relative path to the current directory)
Then simply open your browser to http://localhost:8080 to view your server.
Options
The following configuration options are available:
--host
host address to bind to (defaults to0.0.0.0
)--port
listening port (defaults to8080
)--ssl
enable https (defaults tofalse
)--cert
path to the ssl cert file (defaults tocert.pem
)--key
path to the ssl key file (defaults tokey.pem
)--dir
directory path to serve (defaults to.
, also configurable byarg[0]
)--users
path to users file (defaults tousers.dat
); file should contain lines of username:password in plain text
Development
To develop serve
or interact with its source code in any meaningful way, be
sure you have the following installed:
Prerequisites
Tooling
Note: While the tooling isn't explicitly required in order to build and run the project, it's for everyone's benefit that you leverage it.
Install
You can download and install the project from GitHub by simply running:
git clone [email protected]:syntaqx/serve.git && cd $(basename $_ .git)
make install
This will install serve
into your $GOPATH/bin
directory, which assuming is
properly appended to your $PATH
, can now be used:
$ serve version
serve version v0.0.6-8-g5074d63 windows/amd64
Using serve
manually
Besides running serve
using the provided binary, you can also embed a
serve.FileServer
into your own Go program:
package main
import (
"log"
"net/http"
"github.com/syntaqx/serve"
)
func main() {
fs := serve.NewFileServer()
log.Fatal(http.ListenAndServe(":8080", fs))
}
License
serve
is open source software released under the MIT license.
As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).
As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.
*Note that all licence references and agreements mentioned in the serve README section above
are relevant to that project's source code only.