Shinatra – A simple bash web server
github.com
Shinatra – A simple bash web server
1–10 of 37 posts
Re: Shinatra – A simple bash web server
#2not to be that guy, but that's
1. hardly a web server
2. hardly pure bash
of course writing a server of anything in pure bash is a tad bit difficult, as opposed to a client - bash can connect(), but can't bind() / listen() nor accept() unless, of course, you use something to expose these syscalls, but that opens a whole another can of worms...
Re: Shinatra – A simple bash web server
#3Whats the point of this?
Re: Shinatra – A simple bash web server
#4> Does it work on Windows?
> Of course not.
It works just fine on Windows 10 with WSL.
Re: Shinatra – A simple bash web server
#5I think the point here is to demonstrate that one might think that web servers are mystical beasts (true) but after all, they "just" return a HTTP header and some content.
Re: Shinatra – A simple bash web server
#6Five lines seems like much when you consider that one can write a concurrent (using threads) C webserver in 12...
Re: Shinatra – A simple bash web server
#7Five lines seems like much when you consider that one can write a concurrent (using threads) C webserver in 12...
Do you have a link to the 12 line server?
Re: Shinatra – A simple bash web server
#8I had to look up the colon minus syntax, here's the answer
http://stackoverflow.com/questions/10390406/usage-of-in-bash
Re: Shinatra – A simple bash web server
#9That was both funny and disappointing. I thought it world at least serve static files. Putting netcat in a for loop is hardly a web server in bash.
Re: Shinatra – A simple bash web server
#10Many people here fail to realize, this is an excellent debugging server. I used to have a server to print out the body and headers of requests when building an api to make sure things were going (the right headers and request body) out as expected https://github.com/minhajuddin/httpdebug/blob/master/app.go.
This is a much lighter and nicer version. This is going into my ~/bin/httpdebug :)
You can try sending a few curl requests to see that this really prints the headers and body.
curl -H "api-key: Foo" -X POST --form name=Khaja http://localhost:8080/