From e11dc9345a753d43e8ab92638fad392ec546b8bb Mon Sep 17 00:00:00 2001
From: alex <alex@alexloehr.net>
Date: Sun, 15 Jun 2025 09:56:43 +0000
Subject: [PATCH] GS-2160
---
app.js | 29 +++++++++++++++--------------
1 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/app.js b/app.js
index 76d02e4..97f095d 100644
--- a/app.js
+++ b/app.js
@@ -6,6 +6,7 @@
const fs = require("node:fs")
const db = require("./lib/db")
+const libIlias = require("lib/libIlias")
const settings = require("./settings")
const search = require("./lib/search.js")
@@ -98,6 +99,19 @@
}
})
+ .delete("/api/user/:usr_id", function (req, res) {
+ const {usr_id} = req.params
+ if (!usr_id || isNaN(Number(usr_id))) {
+ return res.code(500).send({status: "error", msg: "userId error"})
+ }
+ else {
+ const res2 = libIlias.deleteUser(usr_id)
+ console.log(res2)
+ return res.send(res2)
+ }
+
+ })
+
/////// ref_id / obj_id ////////////////////////////////////////////////////////////////
.get("/api/ref_id/:ref_id", async function (req, res) {
@@ -174,7 +188,7 @@
})
-/////// STATIC ////////////////////////////////////////////////////////////////
+/////// STATIC / SPA ////////////////////////////////////////////////////////////////
fastify.register(require('@fastify/static'), {
@@ -183,19 +197,6 @@
// constraints: { host: 'example.com' } // optional: default {}
})
-
-
-// fastify.get('*', function (req, reply) {
-// console.log("!!!!!!!!! send index")
-// // index.html should never be cached
-// reply.sendFile('dist/index.html', {maxAge: 0, immutable: false})
-// })
-
-// const favicon = fs.readFileSync("./favicon-32x32.webp")
-// fastify.get("/ui/favicon.webp", async function (req, res) {
-// console.log("<<<<<<<<<<<<<<<<<<<<< favicon", favicon.length)
-// res.type("image/webp").send(favicon)
-// })
const indexFile = fs.readFileSync(path.join(__dirname, "vue/dist", 'index.html'), 'utf8')
fastify.setNotFoundHandler(function (req, res) {
--
Gitblit v1.8.0