DEV Community

Cover image for Microserver: local http server with SPA support
Roberto Huertas
Roberto Huertas

Posted on β€’ Originally published at robertohuertas.com

3 3

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.

--
Originally published at robertohuertas.com on November 1, 2018.

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

AWS GenAI LIVE!

GenAI LIVE! is a dynamic live-streamed show exploring how AWS and our partners are helping organizations unlock real value with generative AI.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❀️