Website Is Served from Nine Neovim Buffers on My Old ThinkPad
6 days ago
- #Neovim
- #LuaJIT
- #Web Server
- The author created a Neovim plugin called 'nvim-web-server' that serves HTTP requests directly from open buffers in Neovim.
- The plugin is written in pure Lua, has no external dependencies, and supports serving content in Djot format.
- Despite being written in Lua, the plugin is faster than Nginx in benchmarks due to leveraging Neovim's libuv bindings and LuaJIT's efficiency.
- The plugin offers benefits like instant content deployment, seamless Git integration, and native Vim keybindings.
- The author deployed the plugin on an old ThinkPad E430 from 2012, showcasing its efficiency even on older hardware.
- Security measures include running Neovim in a Docker container as an unprivileged user, with additional restrictions via AppArmor, seccomp, and netfilter.
- The plugin's performance is attributed to LuaJIT's efficient memory management and allocation strategies, making it faster than Python-based solutions like aiohttp.