UNPKG
node-api-template
Version:
latest (1.0.4)
1.0.4
1.0.3
1.0.2
1.0.1
Node REST API template
github.com/urmillive/node-rest-template
urmillive/node-rest-template
node-api-template
/
controllers
/
indexController.js
10 lines
(8 loc)
•
252 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
const
AppError
=
require
(
'../utils/appError'
);
exports
.
getHome
=
(
req, res, next
) =>
{
try
{ res.
status
(
200
).
json
({
message
:
'Welcome to the backend starter 🚀'
}); }
catch
(err) {
next
(
new
AppError
(
'Something went wrong'
,
500
)); } };