Skip to content

Using shell only to build a web application, based on netcat.

License

Notifications You must be signed in to change notification settings

TangliziGit/shell-webapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shell-webapp

Using shell only to build a web application, based on netcat and nginx, FastCGI.

Deploy via docker

  • netcat version:
    docker pull tanglizi/shell-webapp  
    docker run --name shell-webapp -p 8080:8080 -d tanglizi/shell-webapp
  • nginx version:
    to be continue

Deploy via source code

  • netcat version:
    git clone https://github.com/TangliziGit/shell-webapp.git
    cd shell-webapp
    chmod +x dispatcher.sh handler/* render/* util/*
  • nginx version:
    git clone https://github.com/TangliziGit/shell-webapp.git
    cd shell-webapp
    # modify your nginx.conf
    cp nginx.conf /etc/nginx/nginx.conf

Run

To run the server, netcat version:

./dispatcher.sh 8080

nginx version:

systemctl restart nginx
systemctl restart fcgiwrap

To run a client, you can open a browser and just go http://localhost:8080.
Or you can curl localhost:8080

Unit Test

Requires bats to process unit testing.

bats test/*.bats

Feature

  • page rendering
  • basic logging
  • routing
  • forward and redirect
  • custom HTTP header
  • unit testing
  • docker
  • Github CI/CD on shell scripts and Dockerfile lint & build
  • nginx

Todo

  • web server
  • page rendering
  • basic logging
  • routing
  • forward and redirect
  • custom HTTP header
  • HTTP status table
  • unit testing for handlers
  • docker
  • Github CI/CD on shell scripts and Dockerfile lint & build
  • nginx
  • [] update nginx docker
  • README: explain how it works
  • learn how to write shell
  • basic secure

Note

Notable knowledge about the implementation process is placed in notes.md.

License

MIT License

Copyright (c) 2019 Chunxu Zhang

About

Using shell only to build a web application, based on netcat.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published