New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@amio/serve

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amio/serve

Simple command-line file / directory server built with connect

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

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

@amio/serve npm-version

Handy http/https server, evolved from TJ's original serve, which inspired by nodejitsu's http-server.

Original serve is awesome, but seems lacks of maintenance these days, there's some useful fixes & features added to the codebase since it's latest release in Mar 2014, but couldn't get landed to users, it's more than two years by now.
So here is this ongoing serve, and also an opinionated serve, which removed support for jade and stylus, for a much smaller installation footprint.

Difference with serve:

  • Doesn't support jade and stylus (Opinionated),
  • so comes minimal installation footprint (1.8M vs 15M).
  • -o, --open opens a browser window to this server.
  • -s, --https also serve over https.

Installation

$ npm install -g @amio/serve

Usage

Usage: serve [options] [dir]

Options:

  -h, --help                output usage information
  -V, --version             output the version number
  -o, --open                opens a browser window to this server
  -a, --auth <user>:<pass>  specify basic auth credentials
  -F, --format <fmt>        specify the log format string
  -p, --port <port>         specify the port [3000]
      --https-port <port>   specify the port [3443]
  -H, --hidden              enable hidden file serving
  -I, --no-icons            disable icons
  -L, --no-logs             disable request logging
  -D, --no-dirs             disable directory serving
  -f, --favicon <path>      serve the given favicon
  -c, --cors                allows cross origin access serving
  -s, --https               also serve over https
      --key                 key file path for https
      --cert                certificate file for https
      --ca                  CA certificate file for https
      --compress            gzip or deflate the response
      --exec <cmd>          execute command on each request

Examples

HTTP Accept support built into connect.directory():

$ curl http://localhost:3000/ -H "Accept: text/plain"

  bin
  History.md
  node_modules
  package.json
  Readme.md

Requesting a file:

$ curl http://localhost:3000/README.md

Requesting JSON for the directory listing:

$ curl http://localhost:3000/ -H "Accept: application/json"
["bin","History.md","node_modules","package.json","Readme.md"]

Directory listing served by serve-index middleware.

License

MIT License (c) 2011 TJ Holowaychuk

Keywords

FAQs

Package last updated on 23 Oct 2016

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