Introduction to Http Server for Serving Static Content

I. Introduction

There are times when we want to serve static HTML files from our network. For example, in my case, I'm creating documentation for asciidoc. To review my changes I will need to deploy my HTML files on an HTTP server so that it will be available on the network.

II. NPM Serve

Here comes the npm serve, it's a lightweight HTTP that is freely available.

Usage: There are 2-ways in which serve can be run:

1.) By installing and running:
>npm install serve -g
>serve

serve must be executed in the directory which you want to serve.

2.) By using npx:
>npx serve

Without installing, serve can be run with npx.

III. Reference

  • http://localhost:5000

0 Comments

Post a Comment

Post a Comment (0)

Previous Post Next Post
NERV Open Source

Building production Spring Boot systems?

Explore NERV — open-source Java libraries for audit trails, persistence, exception handling, and reliable event-driven architecture.

Explore NERV on GitHub →