{"id":19767634,"url":"https://github.com/rnelson/server","last_synced_at":"2026-05-10T22:50:21.031Z","repository":{"id":66983302,"uuid":"42057648","full_name":"rnelson/server","owner":"rnelson","description":"A small server script to host content in a directory, with some extras","archived":false,"fork":false,"pushed_at":"2024-07-09T18:12:58.000Z","size":27,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-07-09T22:52:43.518Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rnelson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-07T14:34:02.000Z","updated_at":"2024-07-09T18:13:01.000Z","dependencies_parsed_at":"2023-03-01T16:15:29.225Z","dependency_job_id":"873ca3e3-7c5f-43e0-907b-0041774f5dac","html_url":"https://github.com/rnelson/server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnelson%2Fserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnelson%2Fserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnelson%2Fserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnelson%2Fserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rnelson","download_url":"https://codeload.github.com/rnelson/server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241100201,"owners_count":19909659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T04:31:20.556Z","updated_at":"2026-05-10T22:50:16.003Z","avatar_url":"https://github.com/rnelson.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# server\nSometimes, you just need to serve some static content from a directory. When that happens, `python -m SimpleHTTPServer` or `php -S` is pretty handy, but what if you want a little more?\n\nThis script will handle all of those, but it will also allow you to minify LESS/SASS/SCSS and run Python scripts.\n\n## Installation\n\nserver.py requires a recent version of Python 3.\n\n1. Install the dependencies: `python -m pip install -r requirements.txt` (may require `doas` or `sudo`)\n2. Clone the repo: `git clone https://github.com/rnelson/server.git`\n3. Create a symlink: `ln -s /path/to/server/server.py ~/bin/server`\n\n## Usage\n\nWhatever directory you are in when you run the script is the root. This is now available at [http://localhost:9000](http://localhost:9000).\n\nFor LESS/SASS/SCSS files, give them the appropriate extension (`.less`, `.sass`, `.scss`) and they'll automatically be minified.\n\nThe Python script support relies on `globals()` to pass data from the executing script back to `server`. Two values are read, `output` and `output_type` (the latter defaults to `text/html`) to determine what to display and how to display it. The following is a trivial example:\n\n```\n#! env python\n\ncontent = 'Hello, {}!'.format('World')\nglobals()['output'] = content\nglobals()['output_type'] = 'text/plain'  # defaults to 'text/html'\n\n```\n\n## License\n\nReleased under the [MIT License](http://rnelson.mit-license.org).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frnelson%2Fserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frnelson%2Fserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frnelson%2Fserver/lists"}