This is an HTTP server built using bare-runtime, utilizing the Holesail library for peer-to-peer (P2P) tunneling capabilities. The server enables access to its resources outside a local network, allowing users to connect from anywhere in the world.
Kiwi is based in those libraries:
npm i -g bare
git clone https://github.com/nexhero/Kiwi.git
cd Kiwi
npm install
bare kiwi.js -p 8080 -d /var/www/html
const port = 3001
const server = new Kiwi(port)
server.router.on('GET','/name/:name',(req,res,params)=>{
console.log(params)
res.setHeader('Content-Type', 'text/plain')
res.end("Hello: "+params.name)
})
const nameMW = (req,res)=>{
res.write("This is middleware for route /name \n")
}
server.useMiddleware('/name/*',nameWM)
server.start()
// Or start up server with holesail
//server.start("63d709c4f93884009c3e8db69ad1dfd2000ca5b6a5ae1984a23acffa75d058c2")
The repository comes with a example server
bare example/demo-kiwi.js