REST Service for POPCORN - ILIAS
alex
4 hours ago b512ecf6d0399fdc86aebbad533006ea6fe4af21
adding route /api/ping
2 files modified
6 ■■■■ changed files
app.js 2 ●●● patch | view | raw | blame | history
test/testApiPing.js 4 ●●●● patch | view | raw | blame | history
app.js
@@ -339,7 +339,7 @@
   /////// system ////////////////////////////////////////////////////////////////
   .post("/api/ping", async function (req, res) {
   .get("/api/ping", async function (req, res) {
      try {
         const res2 = await libIlias.ping()
         return res.send(res2)
test/testApiPing.js
@@ -12,13 +12,13 @@
describe("using the API", function () {
    describe("the Route POST /api/ping", function () {
    describe("the Route GET /api/ping", function () {
        it("should return an answer from php component", async function () {
            const url = getUrl(ref_id)
            console.log(url)
            const res = await fetch(url, {
                method: "POST",
                method: "GET",
                body: JSON.stringify({}),
                headers: {
                    'Content-Type': 'application/json', // Indicate JSON data