1.8.0-alpha.2 β€’ Published 5 months ago

@nutsloop/ivy-server v1.8.0-alpha.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
5 months ago

@nutsloop/ivy-server

Facilitating & Enhancing Network Strength

⚠ Alpha Warning: This project is in early development. Expect breaking changes, bugs, and a little chaos. We document with love, but things may shift quickly.


Description

What is Ivy Server?

@nutsloop/ivy-server is a modern, powerful, TypeScript-powered command-line server. With a rust-native file watcher at its core, it enhances developer workflows with features like:

  • βš™οΈ Live browser reloading on file changes (powered by Rust) for instant feedback and seamless development
  • πŸ›°οΈ Static and dynamic content serving
  • πŸ” Built-in route support
  • πŸ§ͺ Zero-config developer experience
  • 🧩 Extensive CLI customisation through flags
  • πŸ› οΈ Experimental control room for remote management, audit via secure sockets (work in progress)
  • 🌐 Multi-domain support β€” Serve content across multiple domains with ease!

Common uses include:

  • ⚑️ Local development servers for fast feedback loops
  • 🌐 Lightweight APIs and microservices
  • πŸ§ͺ Experimental workflows and prototyping

Requirements

  • Supported Operating Systems:

    • Linux (tested on Fedora and Oracle Linux)
    • macOS
    • ⚠ Windows is not supported
  • Software dependencies:


Quick Start

πŸ“¦ Installation

Install via npm:

Important:
@nutsloop/ivy-server runs only on Unix-like systems (macOS, Linux). Windows is currently not supported.
It also requires Node.js v20 or higher.

npm install @nutsloop/ivy-server
npm pkg set type=module

Warning:
@nutsloop/ivy-server is built exclusively with ES Modules (ESM).
Your entire project β€” including all route handlers β€” must use ESM.
CommonJS (require, module.exports) is not supported and will cause runtime errors.

To ensure compatibility:

  • Set "type": "module" in your package.json.
  • Use import / export syntax only.
  • Avoid .cjs or CommonJS-style tooling.

This strict ESM-only setup guarantees cleaner semantics and future-friendly module resolution.


Create a Public Directory

Ivy serves static files from a ./public directory by default. To get started, create the folder and add a basic index.html:

mkdir ./public
echo '<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Ivy Server</title>
  </head>
  <body>
    <h1>Hello from Ivy</h1>
  </body>
</html>' > ./public/index.html

Start the server:

export PATH="$PWD/node_modules/.bin:$PATH"
ivy-server spin

CLI Commands and Flags

Ivy Server includes powerful commands and flags for customisation.

Core Commands

  • spin: Start a single server instance:

    ivy-server spin
  • cluster: Start multiple server instances using Node.js clusters:

    # this will fork for the half of the available cpus
    ivy-server cluster
  • help: View help documentation for commands/flags:

    ivy-server --help
  • version: View the current version of Ivy Server:

    ivy-server --version

🌍 Global Flags

🌍 Global Flags

FlagTypeDescription
--ease, -evoidAllows binding to ports below 1024 (note: system-level restrictions may still apply).
--ease-cluster, -ecvoidRemoves cluster CPU limits β€” allows forking any number of workers.
# let’s assume the server has 8 CPUs available and system-level port restrictions have been eased.
ivy-server --ease --ease-cluster cluster --port=80 --cpus=32

πŸ› οΈ Common Flags

FlagTypeDescription
--address, -astringAddress to bind the server (default: 0.0.0.0).
--port, -pnumberPort to run the server on (default: 3001).
--https, -Svoid\KVPEnable HTTPS.
--log, -lvoidEnable request logging.
--log-color, -lcvoidColorize log output (requires --log).
--log-persistent, -lpvoidPersist logs to file/db (requires logConfig.js).
--log-request-headers, -lrhvoidLog request headers (requires --log).
--acme-challenge, -acvoidServe ACME challenge files, skipping redirects/multidomain.
--control-room, -crvoidOpen a socket for stats/control panel.
--cut-user-agent, -cuavoidHide the user-agent in logs.
--hot-routes, -hrvoidEnable hot reloading of routes.
--live-reload, -lrvoid/KVPLive reload server when files change.
--multi-domain, -mdstringLoad multidomain config from file.
--mute-client-error, -mcevoidSuppress client error logs.
--routes, -rstringPath to custom routes file.
--virtual-routes, -vrstringDeclare STATUS_CODE 200 for addresses (used with --to-index-html).
--to-index-html, -tihvoidRoute all requests to index.html.
--plugins, -ParrayLoad list of comma-separated plugins.
--served-by, -sbstringSet a custom served-by HTTP header.
--socket, -svoidEnable socket/tls connection (requires socketConfig.js).
--redirect-to, -rtstringRedirect requests to another URL (e.g., 301 redirects).
--redirect-to-https, -rthvoidRedirect requests to HTTPS (works with --redirect-to).
--www-root, -wrstringDirectory for static content.

🧠 Cluster-Specific Flags

FlagTypeDescription
--cpus, -cnumber/voidNumber of CPUs to utilize. If no value is provided, defaults to half the available CPUs.
--exec, -estringPath to an entry file to execute in cluster mode.

Example usage:

ivy-server cluster --cpus=4

Advanced Features

Multi-Domain Support

Serve multiple domains with a configuration file:

ivy-server spin --multi-domain=path/to/config.json

Plugin Support

Load plugins dynamically:

ivy-server spin --plugins=plugin1,plugin2

Live Reload

Enable reload of the browser when files change (rust powered in part):

ivy-server spin --live-reload

Development Notes

  • Ivy Server is not production-ready yet.
  • It works on Unix-like operating systems (Linux and macOS). Windows is unsupported.

Links


πŸ’š If you love Ivy Server, it loves you twice!

1.8.0-alpha.2

5 months ago

1.8.0-alpha.1

5 months ago

1.8.0-alpha.0

5 months ago

1.7.2-alpha.1

6 months ago

1.7.2-alpha.0

6 months ago

1.7.1-alpha.17

6 months ago

1.7.1-alpha.16

6 months ago

1.7.1-alpha.15

6 months ago

1.7.1-alpha.14

6 months ago

1.7.1-alpha.13

6 months ago

1.7.1-alpha.12

6 months ago

1.7.1-alpha.11

6 months ago

1.7.1-alpha.10

6 months ago

1.7.1-alpha.9

6 months ago

1.7.1-alpha.8

6 months ago

1.7.1-alpha.7

6 months ago

1.7.1-alpha.6

6 months ago

1.7.1-alpha.5

6 months ago

1.7.1-alpha.4

6 months ago

1.7.1-alpha.3

6 months ago

1.7.1-alpha.2

6 months ago

1.7.1-alpha.1

6 months ago

1.7.1-alpha.0

6 months ago

1.7.0-alpha.0

6 months ago

1.6.0-alpha.0

6 months ago

1.5.0-alpha.2

6 months ago

1.5.0-alpha.1

6 months ago

1.5.0-alpha.0

6 months ago

1.4.0-alpha.4

6 months ago

1.4.0-alpha.3

6 months ago

1.4.0-alpha.2

6 months ago

1.4.0-alpha.1

6 months ago

1.4.0-alpha.0

6 months ago

1.3.0-alpha.14

6 months ago

1.3.0-alpha.13

6 months ago

1.3.0-alpha.12

6 months ago

1.3.0-alpha.11

6 months ago

1.3.0-alpha.10

6 months ago

1.3.0-alpha.9

6 months ago

1.3.0-alpha.8

6 months ago

1.3.0-alpha.7

6 months ago

1.3.0-alpha.6

7 months ago

1.3.0-alpha.5

7 months ago

1.3.0-alpha.4

7 months ago

1.3.0-alpha.3

7 months ago

1.3.0-alpha.2

7 months ago

1.3.0-alpha.1

7 months ago

1.3.0-alpha.0

7 months ago

1.2.0-alpha.19

7 months ago

1.2.0-alpha.18

7 months ago

1.2.0-alpha.17

7 months ago

1.2.0-alpha.16

7 months ago

1.2.0-alpha.15

7 months ago

1.2.0-alpha.14

7 months ago

1.2.0-alpha.13

7 months ago

1.2.0-alpha.12

7 months ago

1.2.0-alpha.11

7 months ago

1.2.0-alpha.10

7 months ago

1.2.0-alpha.9

7 months ago

1.2.0-alpha.8

7 months ago

1.2.0-alpha.7

7 months ago

1.2.0-alpha.6

7 months ago

1.2.0-alpha.5

7 months ago

1.2.0-alpha.4

7 months ago

1.2.0-alpha.3

7 months ago

1.2.0-alpha.2

7 months ago

1.2.0-alpha.1

7 months ago

1.2.0-alpha.0

7 months ago

1.1.0-alpha.4

7 months ago

1.1.0-alpha.3

7 months ago

1.1.0-alpha.2

7 months ago

1.1.0-alpha.1

7 months ago

1.0.0-alpha.43

7 months ago

1.0.0-alpha.42

7 months ago

1.0.0-alpha.41

7 months ago

1.0.0-alpha.40

7 months ago

1.0.0-alpha.39

7 months ago

1.0.0-alpha.38

7 months ago

1.0.0-alpha.37

7 months ago

1.0.0-alpha.36

7 months ago

1.0.0-alpha.35

7 months ago

1.0.0-alpha.34

7 months ago

1.0.0-alpha.33

7 months ago

1.0.0-alpha.32

7 months ago

1.0.0-alpha.31

7 months ago

1.0.0-alpha.30

7 months ago

1.0.0-alpha.29

7 months ago

1.0.0-alpha.28

7 months ago

1.0.0-alpha.27

7 months ago

1.0.0-alpha.26

7 months ago

1.0.0-alpha.25

7 months ago

1.0.0-alpha.24

9 months ago

1.0.0-alpha.23

9 months ago

1.0.0-alpha.22

9 months ago

1.0.0-alpha.21

9 months ago

1.0.0-alpha.20

9 months ago