REST Service for POPCORN - ILIAS
alex
2025-08-13 cf170edeb2ccddadda1e609ea68a24bc9f989e68
GS-2251
1 files added
1 files modified
33 ■■■■■ changed files
bin/pingPhp.js 21 ●●●●● patch | view | raw | blame | history
lib/libIlias.js 12 ●●●●● patch | view | raw | blame | history
bin/pingPhp.js
New file
@@ -0,0 +1,21 @@
const db = require("../lib/db")
const yargs = require("yargs")
const libIlias = require("../lib/libIlias")
/////////////////////////////////////////////////////////////////////////
const argv = yargs
   .usage("$0", "ping ilias php",)
   .strict()
   .parse()
run(argv)
   .then(console.log)
   .catch(console.error)
   .finally(process.exit)
async function run ({}) {
   return libIlias.ping()
}
lib/libIlias.js
@@ -9,6 +9,8 @@
/////////////////////////////////////////////////////////////////////////
module.exports = {
   ping,
   getUser,
   importIliasUser,
@@ -27,6 +29,16 @@
/////////////////////////////////////////////////////////////////////////
async function ping() {
   const sp = new URLSearchParams({
      command: "ping",
      token: iliastoken,
   })
   let url2 = `${url}?${sp.toString()}`
   const res = await fetch(url2, {method: "GET"})
   return await res.json() //
}
/////// GET USER ////////////////////////////////////////////////////////////////
async function getUser (usr_id) {
   const sp = new URLSearchParams({