{"id":28194280,"url":"https://github.com/humansinput/aphttp","last_synced_at":"2025-05-16T13:12:05.412Z","repository":{"id":128773216,"uuid":"225065135","full_name":"humansinput/aphttp","owner":"humansinput","description":"A minimalistic embeddable Tcl web server as well as a library for creating custom ones.","archived":false,"fork":false,"pushed_at":"2019-11-30T20:57:59.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T09:12:06.825Z","etag":null,"topics":["html","http-server","httpd","linux","macos","tcl","tcl-applications","tcl-tk"],"latest_commit_sha":null,"homepage":"","language":"Tcl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"0bsd","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/humansinput.png","metadata":{"files":{"readme":"README.asciidoc","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":"2019-11-30T20:18:08.000Z","updated_at":"2025-05-06T19:18:13.000Z","dependencies_parsed_at":"2023-05-01T03:02:44.017Z","dependency_job_id":null,"html_url":"https://github.com/humansinput/aphttp","commit_stats":null,"previous_names":["humansinput/aphttp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humansinput%2Faphttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humansinput%2Faphttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humansinput%2Faphttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humansinput%2Faphttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/humansinput","download_url":"https://codeload.github.com/humansinput/aphttp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254535800,"owners_count":22087399,"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":["html","http-server","httpd","linux","macos","tcl","tcl-applications","tcl-tk"],"created_at":"2025-05-16T13:11:47.961Z","updated_at":"2025-05-16T13:12:05.388Z","avatar_url":"https://github.com/humansinput.png","language":"Tcl","funding_links":[],"categories":[],"sub_categories":[],"readme":"= apHTTP\n\n**apHTTP** is an extremely minimalistic and embeddable web server written in Tcl as well as a library for creating custom HTTP servers. \n\n== Usage\n\n[source,bash]\n----\n$ tclsh standalone.tcl \u003cport\u003e \u003cdirectory containing HTML, CGI and various other content\u003e \u003cmap file\u003e\n----\n\napHTTP itself by default does not serve anything and is meant to be specified with URL maps on which the server must serve the necessary content. This means that if you do have an ``index.html`` file in the specified static files folder by visiting ``localhost`` on the port on which you've specified you will get a ``404 Not Found``.\n\nThe map file that you need to specify must contain at least one URL map. For example, to serve index.html when your server retreives a connection, add this line to your map file, which must have an extension of ``.map``:\n\n[source]\n----\n/ =\u003e index.html\n----\n\nAssuming that you'll be running the server on port 8000, if the user visits ``http://localhost:8000`` or ``http://\u003cyour IP\u003e:8000/``, the ``index.html`` file will be presented to the user.\n\nIf you have a CGI script that you would like to run, you can create a clean URL for it and add it to the map file, specifying explicitly that the file is executable. For example:\n\n[source]\n----\n/meower =\u003e cgi-bin/generate-meow.tcl CGI\n----\n\nThis will mean that if the user visits ``http://localhost:8000/meower`` or ``http://\u003cyour IP\u003e:8000/meower``, the ``cgi-bin/generate-meow.tcl`` script will be executed. Notice that:\n\n[squares]\n- if the CGI script is not chmodded as executable, the user will get a ``500 Internal Server Error``\n- if the CGI script exists with a non-zero return code, the user will also get a ``500 Internal Server Error``\n\nIf you want to serve all static content from a specific directory without specifying any clean URLs or URL maps, you can use the ``all`` directive and specify the relative path to the folder that you want to serve. For example, I have a folder ``sounds``. If I specify this directive in my map file:\n\n[source]\n----\nall /sounds\n----\n\nAll of the files from the folder ``sounds`` can be accessed by the user directly. For example: ``http://localhost:8000/sounds/meow.wav``.\n\nApart from URL maps, the map file can be filled with mime-type declarations, like this:\n\n[source]\n----\n# the line below will mean that all files with extension .wav will be server with mime-type audio/wav\nwav is audio/wav\n----\n\n== Limitations\n\n[squares]\n- No POST request support, currently. It will be added in a future release, though.\n- No CGI support on Windows. It might not be added in the future, because of problems with environment variables.\n- No documentation for the library part of apHTTP. It will be added soon.\n\n== License\n\nOBSD. See ``LICENSE`` for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumansinput%2Faphttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhumansinput%2Faphttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumansinput%2Faphttp/lists"}