V-Serv-II
Features
- Middlewares
- Propagating
- Builtin / Custom
- Content-Type mapping
- Path-URL mapping customization
- Port customization
- Templating/Indexing
- Event-Oriented
- Caching
(Builtin) Middlewares
- fix - Fixes incorrect URLs
- TODO: .xjs -> .jsx etc...
- directory - Serves index or performs directory indexing
- .noindex (customisable) - empty to block indexing, fill to block specific files
- files starting with '__' (customisable) - blocked from indexing by default
- TODOs: .notmpl - no templating (for .jsx files mostly), and a special request to fetch raw and bypass translation
- static - Serves raw content and compiles templated content
- TODO: Add caching
- Templated content: .xjs, .htmx, .htmlx, .cssx
- end - Applies appropriate headers and ends requests
- TODO: secure - Prevents bruteforcing / DoS (-> HTTP 429)
Templated content example.htmx:
Hello $$usr$$!
. Translated during serving, change templating characters through server options.
Usage
const server = Server classes = Classes; { srv = await server; /**@param*/ await srv; //listen() await srv; //bind custom middleware console; srv; srv;} //start ;
Enable builtin middlewares with the
allowmw
option.
Also take a look inClasses
to see how things work