Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
E
exam_11_back
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zarina
exam_11_back
Commits
7ee45ded
Commit
7ee45ded
authored
Jul 22, 2020
by
Алексей Анпилогов
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#4
, добавила роутер /сategories
parent
3fa8cc31
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
categories.js
app/categories.js
+19
-0
No files found.
app/categories.js
View file @
7ee45ded
const
express
=
require
(
"express"
);
const
Category
=
require
(
'../models/Category'
);
const
createRouter
=
()
=>
{
const
router
=
express
.
Router
();
router
.
get
(
"/"
,
async
(
req
,
res
)
=>
{
try
{
res
.
send
(
await
Category
.
find
());
}
catch
(
e
)
{
res
.
status
(
500
).
send
(
e
)
}
});
return
router
;
};
module
.
exports
=
createRouter
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment