npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@bb301/quick-static-dev-server

v1.0.0

Published

A simple static web server (built with Express) that can be used to serve simple HTML website projects locally during development.

Downloads

1

Readme

Quick Node.js static dev server

This is a static web server (based on Express.js) that I wrote for the purpose of locally serving static HTML website projects during development. I'm sharing it here in case it could be of interest to anyone.

How to install and use

NPM project scope

# Install the package
npm install --save-dev @bb301/quick-static-dev-server

# Run the server
npx quick-static-dev-server

Globally

# Install globally
npm install -g @bb301/quick-static-dev-server

# Use from anywhere
quick-static-dev-server

Configurations

For the moment, server configurations must be done using the following optional environment variables:

  • QUICK_SERVER_PORT – (default: 28080) The server's port number.
  • QUICK_SERVER_HOSTNAME – (default: 127.0.0.1) The server's hostname.
  • QUICK_SERVER_PUBLIC_DIR_PATH – (default: ./; i.e., the directory where the program is run) The directory from where static files will be served.
  • QUICK_SERVER_HTML_INDEX_NAME – (default: index.html) The HTML file to be served for requests made to the GET / endpoint.
  • QUICK_SERVER_SSL_CERT_PATH – The path of the SSL certificate file to be used (enables HTTPS).
  • QUICK_SERVER_SSL_KEY_PATH – The path of the SSL private key file to be used (enables HTTPS).

Example

This is a simple example that illustrates the deployment of a static website on 0.0.0.0:80. The files located inside the ./website directory will be served and requests to the GET / endpoint will be returned the contents of ./website/home.html.

# Server will listen on port 80
export QUICK_SERVER_PORT=80
# Server will be exposed on the LAN
export QUICK_SERVER_HOSTNAME=0.0.0.0
# Server will serve files from the `./website` directory
export QUICK_SERVER_PUBLIC_DIR_PATH=./website
# Server will return `./website/home.html` for requests to `GET /`
export QUICK_SERVER_HTML_INDEX_NAME=home.html

# Start the server
quick-static-dev-server

Contact

If you have any questions, if you find bugs, or if you have suggestions for this project, please feel free to contact me by opening an issue on the repository.

License

This project is released under the MIT License.

Copyright

Copyright (c) 2024 BB-301 ([email protected])