Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
H
hw86AlenBolatov
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
Болатов Ален
hw86AlenBolatov
Commits
98b1cb39
Commit
98b1cb39
authored
Mar 11, 2023
by
Болатов Ален
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#1
added linksRouter
parent
45c84dc2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
index.ts
backend/src/index.ts
+7
-1
linksRouter.ts
backend/src/routes/linksRouter.ts
+11
-0
No files found.
backend/src/index.ts
View file @
98b1cb39
import
express
,
{
Express
}
from
'express'
;
import
{
linksRouter
}
from
'./routes/linksRouter'
;
const
app
:
Express
=
express
();
// app.use
app
.
use
(
express
.
json
());
app
.
use
(
'/links'
,
linksRouter
);
app
.
listen
(
3000
,
()
=>
{
console
.
log
(
`Server is listening on port 3000`
);
});
backend/src/routes/linksRouter.ts
0 → 100644
View file @
98b1cb39
import
express
,
{
Router
,
Request
,
Response
}
from
'express'
;
export
const
linksRouter
:
Router
=
express
.
Router
();
linksRouter
.
get
(
'/'
,
(
req
:
Request
,
res
:
Response
)
=>
{
res
.
send
(
'Hello'
);
});
linksRouter
.
post
(
'/'
,
(
req
:
Request
,
res
:
Response
)
=>
{
res
.
send
(
'Hello'
);
});
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