https://github.com/yokawasa/awk_httpd
GNU AWK HTTP Server Scripts
https://github.com/yokawasa/awk_httpd
awk gnu-awk http-server httpd
Last synced: 2 months ago
JSON representation
GNU AWK HTTP Server Scripts
- Host: GitHub
- URL: https://github.com/yokawasa/awk_httpd
- Owner: yokawasa
- License: mit
- Created: 2017-02-11T02:37:46.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2024-06-18T00:24:24.000Z (almost 2 years ago)
- Last Synced: 2025-04-04T13:15:45.921Z (12 months ago)
- Topics: awk, gnu-awk, http-server, httpd
- Language: Awk
- Size: 120 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AWK HTTPD
GNU AWK HTTP Server Scripts

## Install GNU AWK (if needed)
Please install GNU AWK if not yet installed on your environment
```
# for Mac OS
brew install gawk
# for Ubuntu,Debian apt users
sudo apt-get install gawk
# for CentOS,Fedora,Oracle Linux,Red Hat Enterprise Linux
sudo yum install gawk
```
## Usage
Assuming GNU AWK is installed on your environment, you're ready to run awk_httpd. Simply checkout awk_httpd repository and run the httpd. Default port and document root directory are 8080 and ./ respectively.
```
$ git clone git@github.com:yokawasa/awk_httpd.git
Initialized empty Git repository in github/awk_httpd.git/
remote: Counting objects: 45, done.
remote: Compressing objects: 100% (44/44), done.
remote: Total 45 (delta 11), reused 0 (delta 0)
Receiving objects: 100% (45/45), 13.99 KiB, done.
Resolving deltas: 100% (11/11), done
$ cd awk_httpd
$ ls -1
LICENSE
README.md
httpd.awk
httpd.igawk
img
pages
$ gawk -f ./httpd.awk
$ curl http://localhost:8080/pages/
```
There is an igawk version GNU AWK HTTPD, httpd.igwk. This is basically the same as httpd.awk except parameter options that you can give GNU AWK HTTPD to change default configuration such as port and root document directory
```
$ igawk -f httpd.igawk -h
Usage: httpd.igawk [-p port] [-d docroot] [-h]
Options:
-p port : define server port (default: 8080)
-d docroot : define document root (default: "./")
-h : list available command options
$ igawk -f httpd.igawk -p 8888 -d ./pages
$ curl http://localhost:8888/pages/
```
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/yokawasa/awk_httpd.