igtulm / bashttp Goto Github PK
View Code? Open in Web Editor NEWBash HTTP Server
Bash HTTP Server
If there is no slash at the end in URL, unable to obtain a file which is in a sub-directory of served folder.
For ex:
index file in ./web/some/index.html
url: http://127.0.0.1:3000/some
we get a error:
cat: someindex.html: No such file or directory
but:
url: http://127.0.0.1:3000/some/
provides a result we are expecting
There is a need to split the functionality to modules as the application grows. Bash doesn't provide any convenient includes. To include different parts of the application 'source' is used. It pastes a text of a file specified to main program. So, we can have functions with the same names. To prevent this we can simulate namespaces by adding prefix, for instance, module name to each function in current module.
According to RFC 2616 "19.6.1.1 Changes to Simplify Multi-homed Web Servers and Conserve IP Addresses":
"The requirements that clients and servers support the Host request-header, report an error if the Host request-header (section 14.23) is missing from an HTTP/1.1 request, and accept absolute URIs (section 5.1.2) are among the most important changes defined by this specification."
Edge browser tries to download html files without correct content-type header received from bashttp.
Need to add content type for html files.
Need keep-alive connection to be supported by the server.
Any information can be found at the link below.
https://tools.ietf.org/id/draft-thomson-hybi-http-timeout-01.html
This server doesn't support keep-alive connection type. Before it is not implemented need to set 'Connection' header to 'close'.
https://github.com/koalaman/shellcheck
Use for codestyle validation.
Format all the code using shellcheck.
Functions (such as 'try_route') return a code for server response. But this code is a function's own exit status which could be a 8-bit value from 0 to 255, where 0 means "success". Now it is unable to return, for example, 404 response code. Need to fix and improve that logic.
If page is not available the server needs to send 404 page/message.
For the first time, it's ok to give json message to a client such as
{
"code": 404,
"message": "Not Found"
}
https://github.com/bpkg/bpkg
Add this packet manager to the project
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.