serve-something

0.0.5 • Public • Published

Serve Something

A library / cli tool to serve something.

Features

  • First of all, serve something
    • Just serve files with HTTP protocol
    • BaseUrl could be set to use
    • SPA mode that 404 would be fallback to index.html provided
  • Build executable output
    • This feature is built on top vercel/pkg, many thanks!
    • Here's the things you may config
      • name: The name of output files would look like
      • outpath: The path of folder that output files would be inside
      • targets: The targets' node version, platform and architecture that executable files may run at (the config method is same as vercel/pkg)

Getting Start

Installing

# You may use it as a global CLI tool
$ npm -g install serve-something
# Or just install locally
$ npm install serve-something

Usage

Usage in CLI

Checkout serve-something --help

Usage:
  $ serve-something [rootPath]

Commands:
  [rootPath]  Root path of the files to be served

For more info, run any command with the `--help` flag:
  $ serve-something --help

Options:
  --base <baseUrl>        Input the baseUrl of the served files (default: /)
  --spa                   Serve with "index.html" for 404 not found fallback (default: false)
  --build                 Build executable spa app (default: false)
  --name <outputName>     Output file name or template for several files (default: spa)
  --outpath <outputPath>  Path to save output one or more executables (default: exec-spa)
  --targets <targets>     Comma-separated list of targets 
  -h, --help              Display this message

Usage in programmatic way

Checkout an example in here!

License

Readme

Keywords

none

Package Sidebar

Install

npm i serve-something

Weekly Downloads

47

Version

0.0.5

License

MIT

Unpacked Size

106 kB

Total Files

23

Last publish

Collaborators

  • deviltea