@rip-lang/server 1.3.16 → 1.3.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -45
- package/middleware.rip +1 -0
- package/package.json +2 -2
- package/server.rip +1 -1
package/README.md
CHANGED
|
@@ -47,16 +47,16 @@ bun add -g rip-lang @rip-lang/server
|
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
49
|
# From your app directory (uses ./index.rip, watches *.rip)
|
|
50
|
-
rip
|
|
50
|
+
rip server
|
|
51
51
|
|
|
52
52
|
# Name your app (for mDNS: myapp.local)
|
|
53
|
-
rip
|
|
53
|
+
rip server myapp
|
|
54
54
|
|
|
55
55
|
# Explicit entry file
|
|
56
|
-
rip
|
|
56
|
+
rip server ./app.rip
|
|
57
57
|
|
|
58
58
|
# HTTP only mode
|
|
59
|
-
rip
|
|
59
|
+
rip server http
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
### Example App
|
|
@@ -82,7 +82,7 @@ start()
|
|
|
82
82
|
Run it:
|
|
83
83
|
|
|
84
84
|
```bash
|
|
85
|
-
rip
|
|
85
|
+
rip server
|
|
86
86
|
```
|
|
87
87
|
|
|
88
88
|
Test it:
|
|
@@ -760,18 +760,18 @@ start port: 3000
|
|
|
760
760
|
|
|
761
761
|
### Entry File Resolution
|
|
762
762
|
|
|
763
|
-
When you run `rip
|
|
763
|
+
When you run `rip server`, it looks for your app's entry file:
|
|
764
764
|
|
|
765
765
|
```bash
|
|
766
766
|
# No arguments: looks for index.rip (or index.ts) in current directory
|
|
767
|
-
rip
|
|
767
|
+
rip server
|
|
768
768
|
|
|
769
769
|
# Directory path: looks for index.rip (or index.ts) in that directory
|
|
770
|
-
rip
|
|
770
|
+
rip server ./myapp/
|
|
771
771
|
|
|
772
772
|
# Explicit file: uses that file directly
|
|
773
|
-
rip
|
|
774
|
-
rip
|
|
773
|
+
rip server ./app.rip
|
|
774
|
+
rip server ./src/server.ts
|
|
775
775
|
```
|
|
776
776
|
|
|
777
777
|
### App Naming
|
|
@@ -780,26 +780,26 @@ The **app name** is used for mDNS discovery (e.g., `myapp.local`) and logging. I
|
|
|
780
780
|
|
|
781
781
|
```bash
|
|
782
782
|
# Default: current directory name becomes app name
|
|
783
|
-
~/projects/api$ rip
|
|
783
|
+
~/projects/api$ rip server # app name = "api"
|
|
784
784
|
|
|
785
785
|
# Explicit name: pass a name that's not a file path
|
|
786
|
-
rip
|
|
786
|
+
rip server myapp # app name = "myapp"
|
|
787
787
|
|
|
788
788
|
# With aliases: name@alias1,alias2
|
|
789
|
-
rip
|
|
789
|
+
rip server myapp@api,backend # accessible at myapp.local, api.local, backend.local
|
|
790
790
|
|
|
791
791
|
# Path with alias
|
|
792
|
-
rip
|
|
792
|
+
rip server ./app.rip@myapp # explicit file + custom app name
|
|
793
793
|
```
|
|
794
794
|
|
|
795
795
|
**Examples:**
|
|
796
796
|
|
|
797
797
|
```bash
|
|
798
798
|
# In ~/projects/api/ with index.rip
|
|
799
|
-
rip
|
|
800
|
-
rip
|
|
801
|
-
rip
|
|
802
|
-
rip
|
|
799
|
+
rip server # app = "api", entry = ./index.rip
|
|
800
|
+
rip server myapp # app = "myapp", entry = ./index.rip
|
|
801
|
+
rip server ./server.rip # app = "api", entry = ./server.rip
|
|
802
|
+
rip server ./server.rip@myapp # app = "myapp", entry = ./server.rip
|
|
803
803
|
```
|
|
804
804
|
|
|
805
805
|
## File Watching
|
|
@@ -807,9 +807,9 @@ rip serve ./server.rip@myapp # app = "myapp", entry = ./server.rip
|
|
|
807
807
|
Directory watching is **on by default** — any `.rip` file change in your app directory triggers an automatic rolling restart. Use `--watch=<glob>` to customize the pattern, or `--static` to disable watching entirely.
|
|
808
808
|
|
|
809
809
|
```bash
|
|
810
|
-
rip
|
|
811
|
-
rip
|
|
812
|
-
rip
|
|
810
|
+
rip server # Watches *.rip (default)
|
|
811
|
+
rip server --watch=*.ts # Watch TypeScript files instead
|
|
812
|
+
rip server --static # No watching, no hot reload (production)
|
|
813
813
|
```
|
|
814
814
|
|
|
815
815
|
**How it works:**
|
|
@@ -826,8 +826,8 @@ This is a single kernel-level file descriptor in the main process — no polling
|
|
|
826
826
|
### Basic Syntax
|
|
827
827
|
|
|
828
828
|
```bash
|
|
829
|
-
rip
|
|
830
|
-
rip
|
|
829
|
+
rip server [flags] [app-path] [app-name]
|
|
830
|
+
rip server [flags] [app-path]@<alias1>,<alias2>,...
|
|
831
831
|
```
|
|
832
832
|
|
|
833
833
|
### Flags
|
|
@@ -856,36 +856,36 @@ rip serve [flags] [app-path]@<alias1>,<alias2>,...
|
|
|
856
856
|
### Subcommands
|
|
857
857
|
|
|
858
858
|
```bash
|
|
859
|
-
rip
|
|
860
|
-
rip
|
|
859
|
+
rip server stop # Stop running server
|
|
860
|
+
rip server list # List registered hosts
|
|
861
861
|
```
|
|
862
862
|
|
|
863
863
|
### Examples
|
|
864
864
|
|
|
865
865
|
```bash
|
|
866
866
|
# Development (default: watches *.rip, HTTPS, hot reload)
|
|
867
|
-
rip
|
|
867
|
+
rip server
|
|
868
868
|
|
|
869
869
|
# HTTP only
|
|
870
|
-
rip
|
|
870
|
+
rip server http
|
|
871
871
|
|
|
872
872
|
# Production: 8 workers, no hot reload
|
|
873
|
-
rip
|
|
873
|
+
rip server --static w:8
|
|
874
874
|
|
|
875
875
|
# Custom port
|
|
876
|
-
rip
|
|
876
|
+
rip server http:3000
|
|
877
877
|
|
|
878
878
|
# With mDNS aliases (accessible as myapp.local and api.local)
|
|
879
|
-
rip
|
|
879
|
+
rip server myapp@api
|
|
880
880
|
|
|
881
881
|
# Watch TypeScript files instead of Rip
|
|
882
|
-
rip
|
|
882
|
+
rip server --watch=*.ts
|
|
883
883
|
|
|
884
884
|
# Debug mode
|
|
885
|
-
rip
|
|
885
|
+
rip server --debug
|
|
886
886
|
|
|
887
887
|
# Restart workers after 5000 requests or 1 hour
|
|
888
|
-
rip
|
|
888
|
+
rip server r:5000,3600s
|
|
889
889
|
```
|
|
890
890
|
|
|
891
891
|
## Architecture
|
|
@@ -967,9 +967,9 @@ The server provides these endpoints automatically:
|
|
|
967
967
|
The server ships with a GlobalSign wildcard certificate for `*.ripdev.io`. Combined with DNS (`*.ripdev.io → 127.0.0.1`), every app gets trusted HTTPS automatically:
|
|
968
968
|
|
|
969
969
|
```bash
|
|
970
|
-
rip
|
|
971
|
-
rip
|
|
972
|
-
rip
|
|
970
|
+
rip server streamline # → https://streamline.ripdev.io (green lock)
|
|
971
|
+
rip server analytics # → https://analytics.ripdev.io (green lock)
|
|
972
|
+
rip server myapp # → https://myapp.ripdev.io (green lock)
|
|
973
973
|
```
|
|
974
974
|
|
|
975
975
|
No setup, no flags, no certificate generation. The app name becomes the subdomain.
|
|
@@ -979,7 +979,7 @@ No setup, no flags, no certificate generation. The app name becomes the subdomai
|
|
|
979
979
|
For production domains or custom setups, provide your own cert/key:
|
|
980
980
|
|
|
981
981
|
```bash
|
|
982
|
-
rip
|
|
982
|
+
rip server --cert=/path/to/cert.pem --key=/path/to/key.pem
|
|
983
983
|
```
|
|
984
984
|
|
|
985
985
|
## mDNS Service Discovery
|
|
@@ -988,10 +988,10 @@ The server automatically advertises itself via mDNS (Bonjour/Zeroconf):
|
|
|
988
988
|
|
|
989
989
|
```bash
|
|
990
990
|
# App accessible at myapp.local
|
|
991
|
-
rip
|
|
991
|
+
rip server myapp
|
|
992
992
|
|
|
993
993
|
# Multiple aliases
|
|
994
|
-
rip
|
|
994
|
+
rip server myapp@api,backend
|
|
995
995
|
```
|
|
996
996
|
|
|
997
997
|
Requires `dns-sd` (available on macOS by default).
|
|
@@ -1010,7 +1010,7 @@ get '/', -> 'Hello!'
|
|
|
1010
1010
|
start()
|
|
1011
1011
|
```
|
|
1012
1012
|
|
|
1013
|
-
The `start()` function automatically detects when running under `rip
|
|
1013
|
+
The `start()` function automatically detects when running under `rip server` and registers the handler.
|
|
1014
1014
|
|
|
1015
1015
|
### Pattern 2: Export fetch function directly
|
|
1016
1016
|
|
|
@@ -1028,7 +1028,7 @@ export default
|
|
|
1028
1028
|
|
|
1029
1029
|
## One-Time Setup
|
|
1030
1030
|
|
|
1031
|
-
If a `setup.rip` file exists next to your entry file, `rip
|
|
1031
|
+
If a `setup.rip` file exists next to your entry file, `rip server` runs it
|
|
1032
1032
|
automatically **once** before spawning any workers. This is ideal for database
|
|
1033
1033
|
migrations, table creation, and seeding.
|
|
1034
1034
|
|
|
@@ -1078,7 +1078,7 @@ The server includes a built-in dashboard accessible at `http://rip.local/` (when
|
|
|
1078
1078
|
- **Registered Hosts** — All mDNS aliases being advertised
|
|
1079
1079
|
- **Server Ports** — HTTP/HTTPS port configuration
|
|
1080
1080
|
|
|
1081
|
-
The dashboard uses the same mDNS infrastructure as your app, so it's always available at `rip.local` when any `rip
|
|
1081
|
+
The dashboard uses the same mDNS infrastructure as your app, so it's always available at `rip.local` when any `rip server` instance is running.
|
|
1082
1082
|
|
|
1083
1083
|
## Troubleshooting
|
|
1084
1084
|
|
|
@@ -1094,7 +1094,7 @@ The dashboard uses the same mDNS infrastructure as your app, so it's always avai
|
|
|
1094
1094
|
|
|
1095
1095
|
Rip Server works seamlessly with the `serve` middleware for serving
|
|
1096
1096
|
reactive web applications with hot reload. The `serve` middleware handles
|
|
1097
|
-
framework files, page manifests, and SSE hot-reload — `rip
|
|
1097
|
+
framework files, page manifests, and SSE hot-reload — `rip server` adds HTTPS,
|
|
1098
1098
|
mDNS, multi-worker load balancing, and rolling restarts on top.
|
|
1099
1099
|
|
|
1100
1100
|
### Example: Rip UI App
|
|
@@ -1119,7 +1119,7 @@ start()
|
|
|
1119
1119
|
Run it:
|
|
1120
1120
|
|
|
1121
1121
|
```bash
|
|
1122
|
-
rip
|
|
1122
|
+
rip server
|
|
1123
1123
|
```
|
|
1124
1124
|
|
|
1125
1125
|
This gives you:
|
|
@@ -1136,7 +1136,7 @@ See [Hot Reloading](#hot-reloading) for details on how the two layers (API + UI)
|
|
|
1136
1136
|
|
|
1137
1137
|
## Comparison with Other Servers
|
|
1138
1138
|
|
|
1139
|
-
| Feature | rip
|
|
1139
|
+
| Feature | rip server | PM2 | Nginx |
|
|
1140
1140
|
|---------|-----------|-----|-------|
|
|
1141
1141
|
| Pure Rip | ✅ | ❌ | ❌ |
|
|
1142
1142
|
| Single File | ✅ (~1,200 lines) | ❌ | ❌ |
|
package/middleware.rip
CHANGED
|
@@ -532,6 +532,7 @@ export serve = (opts = {}) ->
|
|
|
532
532
|
components["components/#{path}"] = Bun.file("#{routesDir}/#{path}").text!
|
|
533
533
|
for dir in componentDirs
|
|
534
534
|
for path in Array.from(glob.scanSync(dir)).sort()
|
|
535
|
+
continue if path is 'index.rip' or path.endsWith('/index.rip')
|
|
535
536
|
key = "components/_lib/#{path}"
|
|
536
537
|
components[key] = Bun.file("#{dir}/#{path}").text! unless components[key]
|
|
537
538
|
data = {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rip-lang/server",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.18",
|
|
4
4
|
"description": "Pure Rip web framework and application server",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "api.rip",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"author": "Steve Shreeve <steve.shreeve@gmail.com>",
|
|
46
46
|
"license": "MIT",
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"rip-lang": ">=3.13.
|
|
48
|
+
"rip-lang": ">=3.13.34"
|
|
49
49
|
},
|
|
50
50
|
"files": [
|
|
51
51
|
"api.rip",
|
package/server.rip
CHANGED
|
@@ -125,7 +125,7 @@ logAccessHuman = (app, req, res, totalSeconds, workerSeconds) ->
|
|
|
125
125
|
contentType = (res.headers.get('content-type') or '').split(';')[0] or ''
|
|
126
126
|
sub = if contentType.includes('/') then contentType.split('/')[1] else contentType
|
|
127
127
|
type = (typeAbbrev[sub] or sub or '').padEnd(4)
|
|
128
|
-
console.log "[#{timestamp} #{timezone} #{dur}] #{status} #{type} #{size}
|
|
128
|
+
console.log "[#{timestamp} #{timezone} #{dur}] #{status} #{type} #{size} │ #{method} #{path}"
|
|
129
129
|
|
|
130
130
|
INTERNAL_HEADERS = new Set(['rip-worker-busy', 'rip-worker-id', 'rip-no-log'])
|
|
131
131
|
|