Skip to content

Instantly share code, notes, and snippets.

@radzserg
Last active October 12, 2021 11:56
Show Gist options
  • Save radzserg/2fcdfd5c08e665ebf84bee108527ad56 to your computer and use it in GitHub Desktop.
Save radzserg/2fcdfd5c08e665ebf84bee108527ad56 to your computer and use it in GitHub Desktop.
get_users.ts
import usersRepository from "./path/to/user-repo.ts"
import logger from "./path/to/getLogger.ts"
app.get('/users', function (req, res) {
try {
const users = usersRepository.findAll();
res.send(users);
} catch (e) {
logger.error(e);
throw new InternalSergerError("Cannot get users");
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment