Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
H
hw88AlenBolatov
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
Болатов Ален
hw88AlenBolatov
Commits
35c835d2
Commit
35c835d2
authored
Mar 15, 2023
by
Болатов Ален
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#1
set up category router
parent
5766eedd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
0 deletions
+39
-0
category.ts
backend/src/routes/category.ts
+29
-0
environment.d.ts
backend/src/types/environment.d.ts
+10
-0
No files found.
backend/src/routes/category.ts
0 → 100644
View file @
35c835d2
import
express
,
{
Request
,
Response
}
from
'express'
;
import
{
model
,
Schema
,
HydratedDocument
,
Types
}
from
'mongoose'
;
const
router
=
express
.
Router
();
interface
ICategory
{
name
:
string
;
description
:
string
;
}
const
Category
=
model
<
ICategory
>
(
'Category'
,
new
Schema
({
name
:
{
type
:
String
,
required
:
true
,
},
description
:
{
type
:
String
,
required
:
false
,
},
})
);
router
.
get
(
'/'
,
async
(
req
:
Request
,
res
:
Response
)
=>
{});
router
.
post
(
'/'
,
async
(
req
:
Request
,
res
:
Response
)
=>
{});
export
{
router
as
categoryRouter
};
backend/src/types/environment.d.ts
0 → 100644
View file @
35c835d2
declare
global
{
namespace
NodeJS
{
interface
ProcessEnv
{
PORT
:
string
;
MONGO_URL
:
string
;
}
}
}
export
{};
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