FEATURED
Look, a funny penguin.
ProTip from the ninja trenches: Unlike node, or python3, or perl6, vim is probably already installed on your server - no need for DevOps!
AN EXAMPLE: A WEBSERVER
This simple web server written in vimscript responds with "hello, world" for every request.!while [ $? -eq 0 ]; \ do \ nc -vlp 8080 \ -c "printf 'HTTP/1.0 200 MORNING\r\n\r\nhello, world\n'"; \ done
To run the server, run vim, type i, type the
code in, type
See - you didn't even have to leave the editor!
Here is an example of a simple TCP server which listens on port 1337 and echoes whatever you send it:
!while [ $? -eq 0 ]; do nc -vlp 1337 -c cat; done
At this point it should be clear how to scale that up to a proper web service - just install a bunch of stuff and use it! Easy!