Metadata-Version: 2.4
Name: serveable
Version: 0.0.1
Summary: Open local web applications through a Jupyter server proxy
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: ipython>=7
Requires-Dist: jupyter-server-proxy>=4


# Serveable

Serveable opens web applications running inside a remote Jupyter
environment, such as Noteable, in a separate browser tab.

It uses `jupyter-server-proxy` to make a server running on an internal
port accessible through Jupyter's authenticated web connection.

## Installation

In a Jupyter or Noteable notebook:

```python
%pip install --user serveable
```

## One-Time Setup

Run:

```python
import serveable
serveable.setup()
```
Save the notebook and restart the **whole Jupyter or Noteable server**.
Restarting only the Python kernel is not sufficient.

The setup step normally only needs to be performed once for each account.

## Serving a folder

For a static web application:

```python
from serveable import serve

serve(
    "~/PathFinding.js",
    page="visual/index.html",
    label="Open PathFinding.js"
)
```

Serveable starts a web server on an available port and displays a link
that opens the application in a separate browser tab.

## Linking to an existing server

If another program has already started a server:

```python
from serveable import link

link(
    port=8050,
    page="",
    label="Open application"
)
```

## Stopping the static server

```python
from serveable import stop

stop()
```

Re-running `serve()` automatically stops the previous static server
started by Serveable.
