From 042ef4f7a396065d6e4641623524379538bb0683 Mon Sep 17 00:00:00 2001 From: Duncan Kolba Date: Sun, 30 Apr 2023 12:28:37 +0200 Subject: [PATCH] docs: Add initial documentation --- README.md | 20 +++++++++++++++++--- deno.jsonc | 1 - 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3540546..fdd1a0a 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,29 @@ # LEBERTRAN -Extends the deno file_server from std with live reload via websocket. +Extends the deno `file_server` from `std` with live reload via websocket. ## INSTALL - deno install --allow-net --allow-read lebertran.ts +Install `lebertran` from this repo as a command-line tool: + + deno install --allow-net --allow-read --import-map=deno.jsonc ./lebertran.ts ## RUN +In plain HTTP/WS mode: + lebertran someFolderOnYourComputer +In secure HTTPS mode you will need to pass a certificate and key file: + + lebertran -c localhost.crt -k localhost.key someFolderOnYourComputer", + ## DEVELOPMENT - deno run --allow-net --allow-read --watch lebertran.ts someFolderOnYourComputer +For local development `lebertran` will need localhost certificates (`openssl` needs to be installed): + + deno task certs + +Then `lebertran` can be started in secure mode (HTTPS and WSS enabled) mode with automatic reloading. The contents of the `www` folder in the root directory will be used : + + deno task dev diff --git a/deno.jsonc b/deno.jsonc index a2bdd43..cc38c5f 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -1,6 +1,5 @@ { "tasks": { - "start": "deno run --allow-read --allow-net lebertran.ts -k localhost.key -c localhost.crt www", "dev": "deno run --watch --allow-read --allow-net lebertran.ts -k localhost.key -c localhost.crt www", "certs": "openssl req -x509 -sha256 -nodes -newkey rsa:2048 -days 365 -subj '/CN=localhost' -keyout localhost.key -out localhost.crt" },