diff --git a/webv2/server/api/users/index.get.ts b/webv2/server/api/users/index.get.ts new file mode 100644 index 0000000..1ec7a8a --- /dev/null +++ b/webv2/server/api/users/index.get.ts @@ -0,0 +1,9 @@ +export default defineEventHandler(async () => { + try { + return await UserModel.find() + } catch (e) { + console.error('Failed to get users', e) + + throw createError({ statusCode: 500, statusMessage: 'Failed to get users' }) + } +})