@rip-lang/server 1.3.54 → 1.3.56
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/middleware.rip +8 -5
- package/package.json +2 -2
package/middleware.rip
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
|
|
36
36
|
import { get, enableCorsPreflight } from '@rip-lang/server'
|
|
37
37
|
import { fileURLToPath } from 'node:url'
|
|
38
|
-
import { dirname } from 'node:path'
|
|
38
|
+
import { dirname, resolve } from 'node:path'
|
|
39
39
|
import { existsSync } from 'node:fs'
|
|
40
40
|
|
|
41
41
|
export cors = (opts = {}) ->
|
|
@@ -516,10 +516,13 @@ export serve = (opts = {}) ->
|
|
|
516
516
|
new Response (if useBr then Bun.file(bundlePathBr) else Bun.file(bundlePath)), { headers }
|
|
517
517
|
serve._registered = true
|
|
518
518
|
|
|
519
|
-
# Route: {prefix}
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
c.
|
|
519
|
+
# Route: {prefix}/*.rip — serve .rip files from the app directory tree
|
|
520
|
+
appDirResolved = resolve(appDir)
|
|
521
|
+
get "#{prefix}/*.rip" (c) ->
|
|
522
|
+
name = c.req.path.slice("#{prefix}/".length)
|
|
523
|
+
path = resolve(appDir, name)
|
|
524
|
+
return unless path.startsWith(appDirResolved)
|
|
525
|
+
c.send path, 'text/x-rip; charset=UTF-8' if existsSync(path)
|
|
523
526
|
|
|
524
527
|
# Route: {prefix}/bundle — all components + app data as JSON (cached + Brotli)
|
|
525
528
|
bundleCache = { json: null, br: null, etag: null }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rip-lang/server",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.56",
|
|
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.73"
|
|
49
49
|
},
|
|
50
50
|
"files": [
|
|
51
51
|
"api.rip",
|