ipa
v0.1.2
Published
A lightweight file server built on StoutJS.
Downloads
11
Readme
ipa
A simple and lightweight NodeJS file server built on StoutJS.
Command Line Interface (CLI)
ipa start
Starts the ipa
server.
Options
--config, -c
Specify the configuration file to use. May be formatted as JSON or YAML.
--hostname, -h
Specify the server's hostname.
--address, -a
Address to use (defaults to 0.0.0.0
).
--port, -p
Port to use (defaults to 8080
).
--public, -P
Specify the public root directory. Defaults to the current directory.
--ssl
Enable SSL.
--cert
Path to SSL certificate file.
--key
Path to SSL key file.
ipa stop
Stops the ipa
server.
--force, -f
Force-stop and immediately terminate all connections.
ipa restart
Restarts the ipa
server.
--force, -f
Force-stop and immediately terminate all connections.
ipa status
Show the current status of the ipa
server.
Configuration
ipa
doesn't require any configuration for basic functionality. For more advanced features, use a configuration file or specify options using the command line.
Config Files
ipa
doesn't need any configuration files, but it can use them for more advanced functionality.
Config File Locations
Configuration files can be specified using the command line, or it can discover them automatically. It looks for configuration files in the following locations, in this order:
- The current working directory.
- The current user's home directory, i.e.
~/
/usr/local/etc/
/usr/etc/
/etc/
Config File Naming
When looking for configuration files, ipa
checks for the following file names in the order below:
ipa.json
ipa.yaml
.ipa.json
.ipa.yaml
Configuration files of any name may be specified via the command line.
Example Config Files
The configuration file describes a secure site at https://example.com
which has https://www.example.com
, http://example.com
, and http://www.example.com
all redirecting to the secure, non-www version.
{
"sites": [
{
"hostname": "example.com",
"port": 443,
"public": "/var/www/public",
"ssl": true,
"cert": "/var/certs/example.com.pem",
"key": "/var/certs/example.com.key",
"redirect": ["www.example.com"]
},
{
"hostname": ["example.com", "www.example.com"],
"port": 80,
"redirect": "https://example.com"
}
]
}
Config Options
Note: All relative paths are relative to the configuration file's location.
sites
An array of sites (or virtual hosts) which this ipa
server hosts. Each site may have the following configuration options.
| Site Config | Description |
| ----------------- | ----------------------------------------------------|
| hostname
| The site's hostname. |
| port
| The port on-which to serve the site. |
| public
| The path to the site's public files. |
| redirect
| Generates a 301
redirect to the given address. |
| ssl
| true
to serve the site using HTTPS. |
| cert
| Path to SSL certificate. |
| key
| Path to SSL key file. |
If ipa
is serving only one site, the single-element array can be omitted and these properties may be declared at the config's top-level.
For example, if only one site is to be served, a simple configuration could be:
{
"hostname": "example.com",
"port": 80,
"public": "/var/www"
}