nodeinfo 395 B

123456789101112131415
  1. #!/usr/bin/lua
  2. local announce = require 'gluon.announce'
  3. local json = require 'luci.jsonc'
  4. local util = require 'luci.util'
  5. local nixio = require 'nixio'
  6. local announce_dir = '/lib/gluon/announce/nodeinfo.d/'
  7. io.write("Access-Control-Allow-Origin: *\n")
  8. io.write("Content-type: application/json\n\n")
  9. local data = json.stringify(announce.collect_dir(announce_dir))
  10. io.write(data)
  11. io.flush()