Microserver: local http server with SPA support
The other day, while developing an Angular
application I needed to serve the AoT compiled
version of the app and I used the http-server npm package. To my surprise, it didn’t offer support for SPAs
(Single Page Applications).
That’s when I decided I could use some Rust and build a tool emulating what the http-server npm package does.
Warp to the rescue
The first thing I had to do was to decide which web server framework I would use as a base and I chose Warp because of its friendly API and its amazing and incredible performance.
Then it was just a matter of putting together a few lines of Rust and make it work!
Publishing microserver
Once everything was in place I was ready to publish my first crate
ever!
I have to say that the experience of publishing a crate
is even easier than publishing an npm package
. And after a few commands, microserver was ready to be consumed by anyone!
How to use it
The usage of the crate
is really simple so if you want to know more just browse to crates.io or the project’s Github repo.