Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
H
hw92
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
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
Болатов Ален
hw92
Commits
155eda27
Commit
155eda27
authored
Apr 03, 2023
by
Zhanara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
мелкие изменения
parent
631cd4b3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
145 additions
and
48 deletions
+145
-48
package-lock.json
backend/package-lock.json
+140
-42
package.json
backend/package.json
+2
-2
index.ts
backend/src/index.ts
+3
-4
No files found.
backend/package-lock.json
View file @
155eda27
This diff is collapsed.
Click to expand it.
backend/package.json
View file @
155eda27
...
...
@@ -22,7 +22,6 @@
"mongoose"
:
"^7.0.3"
,
"multer"
:
"^1.4.5-lts.1"
,
"nanoid"
:
"^4.0.2"
,
"ts-node-dev"
:
"^2.0.0"
,
"zod"
:
"^3.21.4"
},
"devDependencies"
:
{
...
...
@@ -30,6 +29,7 @@
"@types/cors"
:
"^2.8.13"
,
"@types/express"
:
"^4.17.17"
,
"@types/jsonwebtoken"
:
"^9.0.1"
,
"@types/multer"
:
"^1.4.7"
"@types/multer"
:
"^1.4.7"
,
"ts-node-dev"
:
"^2.0.0"
}
}
backend/src/index.ts
View file @
155eda27
import
express
,
{
Express
,
json
,
urlencoded
}
from
'express'
;
import
'dotenv/config'
;
import
cors
from
'cors'
;
import
{
mongo
}
from
'./repository/mongoose'
;
import
{
mongo
ose
}
from
'./repository/mongoose'
;
import
{
UsersRouter
}
from
'./routes/user'
;
import
{
CommentController
}
from
'./controllers/comments'
;
import
{
PostsController
}
from
'./controllers/posts'
;
mongo
.
run
();
mongo
ose
.
run
();
const
app
:
Express
=
express
();
app
.
use
(
json
());
...
...
@@ -15,10 +14,10 @@ app.use(urlencoded({extended: true}));
app
.
use
(
express
.
static
(
'public/uploads'
));
app
.
use
(
'/users'
,
UsersRouter
);
app
.
use
(
'/posts'
,
new
PostsController
().
getRouter
())
app
.
use
(
'/comments'
,
new
CommentController
().
getRouter
())
app
.
use
(
'/comments'
,
new
CommentController
().
getRouter
())
app
.
listen
(
process
.
env
.
PORT
,
()
=>
{
console
.
log
(
`App started on port
${
process
.
env
.
PORT
}
`
);
});
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