https://github.com/tailrecursion/lein-simpleton
A Leiningen plugin to serve files out of a local directory -- very similar to Python's SimpleHTTPServer
https://github.com/tailrecursion/lein-simpleton
Last synced: 7 months ago
JSON representation
A Leiningen plugin to serve files out of a local directory -- very similar to Python's SimpleHTTPServer
- Host: GitHub
- URL: https://github.com/tailrecursion/lein-simpleton
- Owner: tailrecursion
- Created: 2013-04-08T19:10:00.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2015-10-28T21:25:10.000Z (over 10 years ago)
- Last Synced: 2025-10-22T01:57:10.463Z (9 months ago)
- Language: Clojure
- Homepage:
- Size: 308 KB
- Stars: 68
- Watchers: 2
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lein-simpleton
A Leiningen plugin to serve files out of a local directory -- very similar to `python -m SimpleHTTPServer `.
## Usage
### System-wide install
Put `[lein-simpleton "1.3.0"]` into the `:plugins` vector of your
`:user` profile, or if you are on Leiningen 1.x do `lein plugin install lein-simpleton 1.3.0`.
### Per-project install
Put `[lein-simpleton "1.3.0"]` into the `:plugins` vector of your project.clj.
### Running
By default Simpleton provides a file-server in the directory where it's run. To run:
$ lein simpleton 5000
Navigate to and see a directory listing. Click around to navigate directories and download (some) files. If a directory contains a file named either `index.html` or `index.htm` then Simpleton will attempt to serve that automatically.
#### `:from`
If you need to run Simpleton to serve files from a specific directory, then you can run something like the following:
lein simpleton 5000 file :from c:\Windows
This is especially useful if you would like to serve a specific sub-directory in a Leiningen-managed project:
lein simpleton 5000 file :from src
By default, the `lein simpleton 5000` will always serve a Leiningen project's root without using the `:from` declaration above.
#### Running the echo server
Simpleton can also run an echo server that reflects the incomming HTTP headers back as [EDN](https://github.com/edn-format/edn) data.
$ lein simpleton 5000 echo
Navigate to ` to download an EDN file.
### Running the hello server
Simpleton can also run a "Hello" server that just returns a canned text string.
$ lein simpleton 5000 hello
Navigating to to see the message.
## Contributing
Patches and pushes welcomed. Please see the [lein-simpleton tickets page](https://github.com/fogus/lein-simpleton/issues) to see if there's something that you like added, or add it, hack and push away.
License
-------
Copyright (C) 2013 Fogus and contributors.
Distributed under the Eclipse Public License, the same as Clojure.