这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@Angelmmiguel
Copy link
Contributor

@Angelmmiguel Angelmmiguel commented Nov 21, 2022

Introduce a new --prefix option to preped a string to all URLs (workers and static assets). This option receives a string that will be properly normalized by the application. If no option is provided, the default value will be "" (no prefix).

This is the outcome from the --help command:

~/W/o/webassembly-functionless ❯❯❯ cargo run -- --help

Wasm Workers Server is a blazing-fast self-contained server that routes HTTP requests to workers in your filesystem. Everything run in a WebAssembly sandbox

Usage: wws [OPTIONS] [PATH]

Arguments:
  [PATH]  Folder to read WebAssembly modules from [default: .]

Options:
      --host <HOSTNAME>  Hostname to initiate the server [default: 127.0.0.1]
  -p, --port <PORT>      Port to initiate the server [default: 8080]
      --prefix <PREFIX>  Prepend the given path to all URLs
  -h, --help             Print help information
  -V, --version          Print version information

Note that this string must use URI format (/X/Y) because it's not a filesystem path. However, I also considered the case that someone introduces a windows path (\X\Y). I considered it because it's easy to implement, but I may drop support in the future.

It closes #31

@Angelmmiguel Angelmmiguel added the 🚀 enhancement New feature or request label Nov 21, 2022
Copy link
Contributor

@assambar assambar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ship it!

@Angelmmiguel Angelmmiguel merged commit 7484a2c into main Nov 22, 2022
@Angelmmiguel Angelmmiguel deleted the 31-add-prefix-option branch May 8, 2023 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add the prefix option to the CLI

4 participants