10 lines
239 B
TypeScript
10 lines
239 B
TypeScript
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' })
|
|
}
|
|
})
|