@rip-lang/server 0.7.6 → 0.7.7

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/server.rip +7 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rip-lang/server",
3
- "version": "0.7.6",
3
+ "version": "0.7.7",
4
4
  "description": "Pure Rip application server — multi-worker, hot reload, HTTPS, mDNS",
5
5
  "type": "module",
6
6
  "main": "server.rip",
package/server.rip CHANGED
@@ -615,6 +615,11 @@ class Server
615
615
  @httpsActive = false
616
616
  @hostRegistry = new Set(['localhost', '127.0.0.1', 'rip.local'])
617
617
  @mdnsProcesses = new Map()
618
+ try
619
+ pkg = JSON.parse(readFileSync(import.meta.dir + '/package.json', 'utf8'))
620
+ @serverVersion = pkg.version
621
+ catch
622
+ @serverVersion = 'unknown'
618
623
 
619
624
  for alias in @flags.appAliases
620
625
  host = if alias.includes('.') then alias else "#{alias}.local"
@@ -729,8 +734,10 @@ class Server
729
734
  uptime = Math.floor((nowMs() - @startedAt) / 1000)
730
735
  healthy = @sockets.length > 0
731
736
  hosts = Array.from(@hostRegistry.values())
737
+ version = @serverVersion
732
738
  body = JSON.stringify
733
739
  status: if healthy then 'healthy' else 'degraded'
740
+ version: version
734
741
  app: @flags.appName
735
742
  workers: @sockets.length
736
743
  ports: { http: @flags.httpPort or undefined, https: @flags.httpsPort or undefined }