Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
H
Homework_95_Tsoy_Danil
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
Цой Данил
Homework_95_Tsoy_Danil
Commits
26a5a882
Commit
26a5a882
authored
Apr 12, 2023
by
Цой Данил
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added express-ws library to backend
parent
a7998f78
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
80 additions
and
360 deletions
+80
-360
package-lock.json
backend/package-lock.json
+76
-24
package.json
backend/package.json
+2
-0
index.ts
backend/src/index.ts
+2
-0
.gitignore
websocket/.gitignore
+0
-1
package-lock.json
websocket/package-lock.json
+0
-206
package.json
websocket/package.json
+0
-25
tsconfig.json
websocket/tsconfig.json
+0
-104
No files found.
backend/package-lock.json
View file @
26a5a882
This diff is collapsed.
Click to expand it.
backend/package.json
View file @
26a5a882
...
@@ -12,12 +12,14 @@
...
@@ -12,12 +12,14 @@
"license"
:
"ISC"
,
"license"
:
"ISC"
,
"dependencies"
:
{
"dependencies"
:
{
"@types/cors"
:
"^2.8.13"
,
"@types/cors"
:
"^2.8.13"
,
"@types/express-ws"
:
"^3.0.1"
,
"@types/jsonwebtoken"
:
"^9.0.1"
,
"@types/jsonwebtoken"
:
"^9.0.1"
,
"@types/shortid"
:
"^0.0.29"
,
"@types/shortid"
:
"^0.0.29"
,
"bcrypt"
:
"^5.1.0"
,
"bcrypt"
:
"^5.1.0"
,
"cors"
:
"^2.8.5"
,
"cors"
:
"^2.8.5"
,
"dotenv"
:
"^16.0.3"
,
"dotenv"
:
"^16.0.3"
,
"express"
:
"^4.18.2"
,
"express"
:
"^4.18.2"
,
"express-ws"
:
"^5.0.2"
,
"jsonwebtoken"
:
"^9.0.0"
,
"jsonwebtoken"
:
"^9.0.0"
,
"mongodb"
:
"^5.1.0"
,
"mongodb"
:
"^5.1.0"
,
"mongoose"
:
"^7.0.3"
,
"mongoose"
:
"^7.0.3"
,
...
...
backend/src/index.ts
View file @
26a5a882
...
@@ -5,6 +5,7 @@ import { healthCheckController } from "./controllers/healthCheck";
...
@@ -5,6 +5,7 @@ import { healthCheckController } from "./controllers/healthCheck";
import
{
mongooseDB
}
from
"./repository/mongooseDB"
;
import
{
mongooseDB
}
from
"./repository/mongooseDB"
;
import
{
usersController
}
from
"./controllers/usersController"
;
import
{
usersController
}
from
"./controllers/usersController"
;
import
{
messagesController
}
from
"./controllers/messagesController"
;
import
{
messagesController
}
from
"./controllers/messagesController"
;
import
expressWs
from
"express-ws"
;
dotenv
.
config
()
dotenv
.
config
()
...
@@ -12,6 +13,7 @@ class App {
...
@@ -12,6 +13,7 @@ class App {
private
app
:
Express
private
app
:
Express
constructor
()
{
constructor
()
{
this
.
app
=
express
()
this
.
app
=
express
()
expressWs
(
this
.
app
)
this
.
app
.
use
(
express
.
json
())
this
.
app
.
use
(
express
.
json
())
this
.
app
.
use
(
cors
())
this
.
app
.
use
(
cors
())
}
}
...
...
websocket/.gitignore
deleted
100644 → 0
View file @
a7998f78
/node_modules
\ No newline at end of file
websocket/package-lock.json
deleted
100644 → 0
View file @
a7998f78
{
"name"
:
"homework"
,
"version"
:
"1.0.0"
,
"lockfileVersion"
:
2
,
"requires"
:
true
,
"packages"
:
{
""
:
{
"name"
:
"homework"
,
"version"
:
"1.0.0"
,
"license"
:
"ISC"
,
"dependencies"
:
{
"@types/cors"
:
"^2.8.13"
,
"@types/dotenv"
:
"^8.2.0"
,
"@types/shortid"
:
"^0.0.29"
,
"@types/ws"
:
"^8.5.4"
,
"cors"
:
"^2.8.5"
,
"dotenv"
:
"^16.0.3"
,
"shortid"
:
"^2.2.16"
,
"ws"
:
"^8.13.0"
}
},
"node_modules/@types/cors"
:
{
"version"
:
"2.8.13"
,
"resolved"
:
"https://registry.npmjs.org/@types/cors/-/cors-2.8.13.tgz"
,
"integrity"
:
"sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA=="
,
"dependencies"
:
{
"@types/node"
:
"*"
}
},
"node_modules/@types/dotenv"
:
{
"version"
:
"8.2.0"
,
"resolved"
:
"https://registry.npmjs.org/@types/dotenv/-/dotenv-8.2.0.tgz"
,
"integrity"
:
"sha512-ylSC9GhfRH7m1EUXBXofhgx4lUWmFeQDINW5oLuS+gxWdfUeW4zJdeVTYVkexEW+e2VUvlZR2kGnGGipAWR7kw=="
,
"deprecated"
:
"This is a stub types definition. dotenv provides its own type definitions, so you do not need this installed."
,
"dependencies"
:
{
"dotenv"
:
"*"
}
},
"node_modules/@types/node"
:
{
"version"
:
"18.15.11"
,
"resolved"
:
"https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz"
,
"integrity"
:
"sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q=="
},
"node_modules/@types/shortid"
:
{
"version"
:
"0.0.29"
,
"resolved"
:
"https://registry.npmjs.org/@types/shortid/-/shortid-0.0.29.tgz"
,
"integrity"
:
"sha512-9BCYD9btg2CY4kPcpMQ+vCR8U6V8f/KvixYD5ZbxoWlkhddNF5IeZMVL3p+QFUkg+Hb+kPAG9Jgk4bnnF1v/Fw=="
},
"node_modules/@types/ws"
:
{
"version"
:
"8.5.4"
,
"resolved"
:
"https://registry.npmjs.org/@types/ws/-/ws-8.5.4.tgz"
,
"integrity"
:
"sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg=="
,
"dependencies"
:
{
"@types/node"
:
"*"
}
},
"node_modules/cors"
:
{
"version"
:
"2.8.5"
,
"resolved"
:
"https://registry.npmjs.org/cors/-/cors-2.8.5.tgz"
,
"integrity"
:
"sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g=="
,
"dependencies"
:
{
"object-assign"
:
"^4"
,
"vary"
:
"^1"
},
"engines"
:
{
"node"
:
">= 0.10"
}
},
"node_modules/dotenv"
:
{
"version"
:
"16.0.3"
,
"resolved"
:
"https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz"
,
"integrity"
:
"sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ=="
,
"engines"
:
{
"node"
:
">=12"
}
},
"node_modules/nanoid"
:
{
"version"
:
"2.1.11"
,
"resolved"
:
"https://registry.npmjs.org/nanoid/-/nanoid-2.1.11.tgz"
,
"integrity"
:
"sha512-s/snB+WGm6uwi0WjsZdaVcuf3KJXlfGl2LcxgwkEwJF0D/BWzVWAZW/XY4bFaiR7s0Jk3FPvlnepg1H1b1UwlA=="
},
"node_modules/object-assign"
:
{
"version"
:
"4.1.1"
,
"resolved"
:
"https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz"
,
"integrity"
:
"sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="
,
"engines"
:
{
"node"
:
">=0.10.0"
}
},
"node_modules/shortid"
:
{
"version"
:
"2.2.16"
,
"resolved"
:
"https://registry.npmjs.org/shortid/-/shortid-2.2.16.tgz"
,
"integrity"
:
"sha512-Ugt+GIZqvGXCIItnsL+lvFJOiN7RYqlGy7QE41O3YC1xbNSeDGIRO7xg2JJXIAj1cAGnOeC1r7/T9pgrtQbv4g=="
,
"dependencies"
:
{
"nanoid"
:
"^2.1.0"
}
},
"node_modules/vary"
:
{
"version"
:
"1.1.2"
,
"resolved"
:
"https://registry.npmjs.org/vary/-/vary-1.1.2.tgz"
,
"integrity"
:
"sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="
,
"engines"
:
{
"node"
:
">= 0.8"
}
},
"node_modules/ws"
:
{
"version"
:
"8.13.0"
,
"resolved"
:
"https://registry.npmjs.org/ws/-/ws-8.13.0.tgz"
,
"integrity"
:
"sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA=="
,
"engines"
:
{
"node"
:
">=10.0.0"
},
"peerDependencies"
:
{
"bufferutil"
:
"^4.0.1"
,
"utf-8-validate"
:
">=5.0.2"
},
"peerDependenciesMeta"
:
{
"bufferutil"
:
{
"optional"
:
true
},
"utf-8-validate"
:
{
"optional"
:
true
}
}
}
},
"dependencies"
:
{
"@types/cors"
:
{
"version"
:
"2.8.13"
,
"resolved"
:
"https://registry.npmjs.org/@types/cors/-/cors-2.8.13.tgz"
,
"integrity"
:
"sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA=="
,
"requires"
:
{
"@types/node"
:
"*"
}
},
"@types/dotenv"
:
{
"version"
:
"8.2.0"
,
"resolved"
:
"https://registry.npmjs.org/@types/dotenv/-/dotenv-8.2.0.tgz"
,
"integrity"
:
"sha512-ylSC9GhfRH7m1EUXBXofhgx4lUWmFeQDINW5oLuS+gxWdfUeW4zJdeVTYVkexEW+e2VUvlZR2kGnGGipAWR7kw=="
,
"requires"
:
{
"dotenv"
:
"*"
}
},
"@types/node"
:
{
"version"
:
"18.15.11"
,
"resolved"
:
"https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz"
,
"integrity"
:
"sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q=="
},
"@types/shortid"
:
{
"version"
:
"0.0.29"
,
"resolved"
:
"https://registry.npmjs.org/@types/shortid/-/shortid-0.0.29.tgz"
,
"integrity"
:
"sha512-9BCYD9btg2CY4kPcpMQ+vCR8U6V8f/KvixYD5ZbxoWlkhddNF5IeZMVL3p+QFUkg+Hb+kPAG9Jgk4bnnF1v/Fw=="
},
"@types/ws"
:
{
"version"
:
"8.5.4"
,
"resolved"
:
"https://registry.npmjs.org/@types/ws/-/ws-8.5.4.tgz"
,
"integrity"
:
"sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg=="
,
"requires"
:
{
"@types/node"
:
"*"
}
},
"cors"
:
{
"version"
:
"2.8.5"
,
"resolved"
:
"https://registry.npmjs.org/cors/-/cors-2.8.5.tgz"
,
"integrity"
:
"sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g=="
,
"requires"
:
{
"object-assign"
:
"^4"
,
"vary"
:
"^1"
}
},
"dotenv"
:
{
"version"
:
"16.0.3"
,
"resolved"
:
"https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz"
,
"integrity"
:
"sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ=="
},
"nanoid"
:
{
"version"
:
"2.1.11"
,
"resolved"
:
"https://registry.npmjs.org/nanoid/-/nanoid-2.1.11.tgz"
,
"integrity"
:
"sha512-s/snB+WGm6uwi0WjsZdaVcuf3KJXlfGl2LcxgwkEwJF0D/BWzVWAZW/XY4bFaiR7s0Jk3FPvlnepg1H1b1UwlA=="
},
"object-assign"
:
{
"version"
:
"4.1.1"
,
"resolved"
:
"https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz"
,
"integrity"
:
"sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="
},
"shortid"
:
{
"version"
:
"2.2.16"
,
"resolved"
:
"https://registry.npmjs.org/shortid/-/shortid-2.2.16.tgz"
,
"integrity"
:
"sha512-Ugt+GIZqvGXCIItnsL+lvFJOiN7RYqlGy7QE41O3YC1xbNSeDGIRO7xg2JJXIAj1cAGnOeC1r7/T9pgrtQbv4g=="
,
"requires"
:
{
"nanoid"
:
"^2.1.0"
}
},
"vary"
:
{
"version"
:
"1.1.2"
,
"resolved"
:
"https://registry.npmjs.org/vary/-/vary-1.1.2.tgz"
,
"integrity"
:
"sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="
},
"ws"
:
{
"version"
:
"8.13.0"
,
"resolved"
:
"https://registry.npmjs.org/ws/-/ws-8.13.0.tgz"
,
"integrity"
:
"sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA=="
,
"requires"
:
{}
}
}
}
websocket/package.json
deleted
100644 → 0
View file @
a7998f78
{
"name"
:
"homework"
,
"version"
:
"1.0.0"
,
"description"
:
""
,
"main"
:
"index.js"
,
"scripts"
:
{
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
},
"repository"
:
{
"type"
:
"git"
,
"url"
:
"ssh://git@git.attractor-school.com:30022/Danil_Tsoy/homework_95_tsoy_danil.git"
},
"author"
:
""
,
"license"
:
"ISC"
,
"dependencies"
:
{
"@types/cors"
:
"^2.8.13"
,
"@types/dotenv"
:
"^8.2.0"
,
"@types/shortid"
:
"^0.0.29"
,
"@types/ws"
:
"^8.5.4"
,
"cors"
:
"^2.8.5"
,
"dotenv"
:
"^16.0.3"
,
"shortid"
:
"^2.2.16"
,
"ws"
:
"^8.13.0"
}
}
websocket/tsconfig.json
deleted
100644 → 0
View file @
a7998f78
This diff is collapsed.
Click to expand it.
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