Skip to content

Neo is a Single File Server. It Responds to Every GET Request it Receives with the Content of a Given File (Specified by ENV or CLI Argument), and for Every Other Request (with any other HTTP Method or Path) it returns a 404. Written in GoLang & Rust Separately.

Notifications You must be signed in to change notification settings

visheshc14/Neo-Go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neo

Neo is a single file server. It responds to every GET request it receives with the content of a given file (specified by ENV or CLI argument), and for every other request (with any other HTTP method or path) it returns a 404.

Neo was invented to help with cases where a generally small file needs to be delivered at a certain path, for example MTA STS's /.well-known/mta-sts.txt.

See also Neo-Rust

Quickstart

Neo only needs the path to a single file to run:

$ Neo <file path>

By default, Neo will serve the file at host 127.0.0.1 on port 5000. Neo can also take file content from STDIN like so:

$ Neo <<EOF
> your file content
> goes here
> EOF

Docker

To run Neo with docker:

$ docker run --detach \
-p 5000:5000 \
-e HOST=0.0.0.0 \
-e FILE=/data/file \
-v /path/to/folder/with/your/file:/data \
--name Neo-go \
registry.gitlab.com/visheshc14/Neo-Go/cli:v2

Note that v1 of Neo-Go used net/http, and v2 uses fasthttp.

Usage

$ ./Neo --help
Usage of ./Neo:
  -file string
        File to read
  -host string
        Host
  -port int
        Port (default -1)
  -stdin-read-timeout-seconds int
        Amount of seconds to wait for input on STDIN to serve (default -1)

Environment Variables

ENV variable Default Example Description
HOST 127.0.0.1 0.0.0.0 The host on which Neo will listen
PORT 5000 3000 The port on which Neo will listen
FILE N/A /path/to/your/file The path to the file that will be served
STDIN_READ_TIMEOUT_SECONDS 60 10 The amount of seconds to try and read from STDIN

About

Neo is a Single File Server. It Responds to Every GET Request it Receives with the Content of a Given File (Specified by ENV or CLI Argument), and for Every Other Request (with any other HTTP Method or Path) it returns a 404. Written in GoLang & Rust Separately.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published