Skip to content

A simple Go (golang) server, primarily created to quickly serve static content from a server-like environment.

License

Notifications You must be signed in to change notification settings

MilosRandelovic/quick-static-server-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Overview

This is a quick golang server meant to serve static (HTML & other) content from a local folder.

Installation

Clone the repository to a local folder, and make sure you have go installed.

Usage

You can serve content from any local folder:

go run server.go -d /path/to/your/files

If you don't supply a directory path using the -d argument, it will by default serve content from the current . folder.

The default address to serve content from is localhost:3000. You can change the port via the -p argument:

go run server.go -p 1234 -d /path/to/your/files

Note that the app will by default log every single request in the console. To change this, edit the server.go file and comment the logging instruction in the logEveryRequest function.

About

A simple Go (golang) server, primarily created to quickly serve static content from a server-like environment.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages