-
Notifications
You must be signed in to change notification settings - Fork 21
2.2 Controllers
leonardo Rico edited this page Nov 20, 2017
·
1 revision
Create a file with .js extension in the /src/api/controllers folder
src/api/controllers/hello.js
import { result, notFound, error } from 'express-easy-helper';
import Hello from '../models/hello';
export function list(req, res) {
return Hello.find().exec()
.then(notFound(res))
.then(result(res))
.catch(error(res));
}
More info express-easy-helper
Nodetomic Api Swagger