Giter Club home page Giter Club logo

neo-go's Introduction

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

neo-go's People

Contributors

visheshc14 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.