@kwalox/create-node-app
Version:
CLI command to bootstrap Node project
13 lines (10 loc) • 343 B
text/typescript
import { Request, Response } from "express";
import { getAllUsers } from "./user.service";
export async function getAllUsersHandler(req: Request, res: Response) {
const [users, error] = getAllUsers();
if (error) {
console.log(error)
return res.status(500).send("Something went wrong")
}
return res.json({data: users})
}