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

luvi

Package Overview
Dependencies
Maintainers
1
Versions
139
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

luvi - npm Package Compare versions

Comparing version 0.6.9 to 0.7.2

2

package.json
{
"name": "luvi",
"version": "0.6.9",
"version": "0.7.2",
"description": "dev server with simple api and easy config",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/zacanger/luvi.git",

@@ -9,3 +9,5 @@ # luvi

By default, `luvi` acts as a static server, serving the files in `cwd`. It can also redirect requests to a back-end.
By default, `luvi` acts as a static server, serving the files in `cwd`.
It can also redirect requests to a back-end.
On launch, `luvi` will open a tab in your default browser pointing to your defined root.

@@ -19,3 +21,4 @@ --------

`luvi` looks inside `cwd` for a `.luvi.json` config file. If there is no config file, the default static server is launched.
`luvi` looks inside `cwd` for a `.luvi.json` config file.
If there is no config file, the default static server is launched.

@@ -32,38 +35,40 @@ #### [server, ...]

Command-line arguments take priority over config files and defaults. In a path with a `.luvi.json` file, running `luvi` will follow the options in the file, unless any options are passed; if there are multiple servers in the `.luvi.json` file, every server's options will be overridden. Project root is `cwd` by default.
Command-line arguments take priority over config files and defaults.
In a path with a `.luvi.json` file, running `luvi` will follow the options in the file,
unless any options are passed; if there are multiple servers in the `.luvi.json` file,
every server's options will be overridden. Project root is `cwd` by default.
$ luvi -h # Shows a shortened version of this README
$ luvi -v # Displays luvi's version
$ luvi -c /path/to/some/config.json # Use a non-default config file
$ luvi -n # Ignore the config file in`cwd`--useful for `-r`
$ luvi -r /path/to/your/project # Serve from a different directory
$ luvi -p 1337 # Serve from specified port--for ports below 1024, run `luvi` as root
$ luvi # launches the default server
$ luvi foo bar # starts luvi servers `foo` & `bar`
$ luvi -p 1337 # serves from specified port--must be root to use ports below 1024
$ luvi -r /path/to/www/root # serves from specified directory
$ luvi -c /path/to/config.json # uses a non-default config file
$ luvi -n # ignores the config file in `cwd`--useful for options like `-r`
$ luvi -v # display's luvi's version
$ luvi -h # shows a version of this help dialog
### .luvi.json
To configure a single server: `{"root":"public","port":9090}`. The object will be passed directly to `luvi`.
To configure a single server: `{"root":"public","port":9090}`.
The object will be passed directly to `luvi`.
For multiple servers, simply use an array of single-server configs. Use the `name` option to keep track of servers in logs.
For multiple servers, simply use an array of single-server configs.
Use the `name` option to keep track of servers in logs.
[
{
"name": "dev",
"root": "main",
"port": 1337,
"fixtures": {
"/api": "test/fixtures"
}
},{
"name": "staging",
"root": "pub",
"port": 4444,
"proxy": {
"/api": "http://backend:1207/app"
}
},{
"name": "doc",
"root": "doc",
"port": 5000
[{
"name": "drafts",
"root": "src",
"port": 1337
},{
"name": "testing",
"root": "build",
"port": 7090,
"proxy": {
"/api": "http://back-end:1207/app/testing"
}
]
},{
"name": "todo",
"root": "doc",
"port": 6565
}]

@@ -85,9 +90,15 @@ --------

These defaults are merged with whatever you pass, so if, for example, you only pass in a custom server name, `luvi` will still run on port 4444 and use `cwd` as the root to serve.
These defaults are merged with whatever you pass, so if, for example,
you only pass in a custom server name, `luvi` will still run on port 4444
and use `cwd` as the root to serve.
Multiple servers can be launched from the same script, with different configs, by calling `luvi()` again with different options.
Multiple servers can be launched from the same script, with different configs,
by calling `luvi()` again with different options.
If you define a `proxy` property and a request matches one of the specified contexts, that request will be handled by the proxy middleware.
If you define a `proxy` property and a request matches one of the specified
contexts, that request will be handled by the proxy middleware.
If the proxy middleware doesn't handle the request, it'll be passed on to the static middleware. If the static middleware can't handle the request, it will return an HTTP error response.
If the proxy middleware doesn't handle the request, it'll be passed on to
the static middleware. If the static middleware can't handle the request,
it will return an HTTP error response.

@@ -94,0 +105,0 @@ #### options

@@ -5,11 +5,12 @@ the luvi server

luvi -h # this help
luvi -v # luvi version
luvi # launch default server
luvi foo bar # start luvi servers `foo` & `bar`
luvi -p 1337 # port to listen on for requests
luvi -r /path/to/www/root # root dir to serve
luvi -c /path/to/config.json # use non-default config file
luvi -n # ignore `.luvi.json` in cwd
luvi foo bar # start luvi servers `foo` & `bar`
luvi -r /path/to/www/root # root dir to serve
luvi -p 1337 # port to listen on for requests
luvi -v # luvi version
luvi -h # this help
see the readme for config options and api usage
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