Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ssl-serve

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ssl-serve

Static file serving and directory listing

  • 6.5.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
209
decreased by-7.52%
Maintainers
1
Weekly downloads
 
Created
Source

ssl-serve

Note by Tim Daubenschütz

During a re-write vercel removed the support for serve's --ssl flag. However, a user named jwarby pointed out that version 6 still included it and was working fine. I noticed that version 6 had vulnerabilities though, so I decided to fork v6 of vercel/serve to remove them.

I'm likely to maintain this this package as I'm planning on using it in my projects.

Usage

npm install -g ssl-serve

Once that's done, you can run this command inside your project's directory:

serve [options] <path>

Serve Content Via HTTP and automatic SSL Cert generation

Just use the --ssl option. Make sure to accept the self-signed certificate in your browser too.

Options

Run this command to see a list of all available options:

serve help

Authentication

If you set the --auth flag, the package will look for a username and password in the SERVE_USER and SERVE_PASSWORD environment variables.

As an example, this is how such a command could look like:

SERVE_USER=leo SERVE_PASSWORD=1234 serve --auth

API

You can also use the package inside your application. Just load it:

const serve = require('serve')

And call it with flags (run this command for the full list):

const server = serve(__dirname, {
  port: 1337,
  ignore: ['node_modules']
})

Later in the code, you can stop the server using this method:

server.stop()

Contributing

I'm happy to merge contributor's PRs.

License

See License.

Authors

Leo Lamprecht (@notquiteleo) - Vercel Tim Daubenschuetz tim.daubenschuetz@gmail.com

Keywords

FAQs

Package last updated on 04 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc