Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
game-server-flip-jump
Project
Project
Details
Activity
Releases
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
Vũ Gia Vương
game-server-flip-jump
Commits
2ce56318
Commit
2ce56318
authored
Aug 19, 2025
by
Vũ Gia Vương
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add path /socket
parent
8d0f13ca
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
7 deletions
+10
-7
index.js
dist/index.js
+1
-0
server.js
dist/server.js
+3
-3
index.ts
src/index.ts
+2
-1
server.ts
src/server.ts
+4
-3
No files found.
dist/index.js
View file @
2ce56318
...
@@ -10,6 +10,7 @@ const socket_1 = require("./socket");
...
@@ -10,6 +10,7 @@ const socket_1 = require("./socket");
const
PORT
=
3001
;
const
PORT
=
3001
;
const
server
=
http_1
.
default
.
createServer
(
server_1
.
default
);
const
server
=
http_1
.
default
.
createServer
(
server_1
.
default
);
const
io
=
new
socket_io_1
.
Server
(
server
,
{
const
io
=
new
socket_io_1
.
Server
(
server
,
{
path
:
'/socket'
,
cors
:
{
cors
:
{
// origin: '*',
// origin: '*',
methods
:
[
"GET"
,
"POST"
],
methods
:
[
"GET"
,
"POST"
],
...
...
dist/server.js
View file @
2ce56318
...
@@ -11,7 +11,7 @@ app.use(express_1.default.json());
...
@@ -11,7 +11,7 @@ app.use(express_1.default.json());
app
.
get
(
'/'
,
(
req
,
res
,
next
)
=>
{
app
.
get
(
'/'
,
(
req
,
res
,
next
)
=>
{
res
.
send
(
'Hello World'
);
res
.
send
(
'Hello World'
);
});
});
app
.
get
(
'/socket'
,
(
req
,
res
,
next
)
=>
{
// app.get('/socket', (req: Request, res: Response, next: NextFunction
) => {
res
.
send
(
'socket'
);
// res.send('socket')
});
// })
exports
.
default
=
app
;
exports
.
default
=
app
;
src/index.ts
View file @
2ce56318
...
@@ -7,11 +7,12 @@ const PORT = 3001;
...
@@ -7,11 +7,12 @@ const PORT = 3001;
const
server
=
http
.
createServer
(
app
);
const
server
=
http
.
createServer
(
app
);
const
io
=
new
Server
(
server
,
{
const
io
=
new
Server
(
server
,
{
path
:
'/socket'
,
cors
:
{
cors
:
{
// origin: '*',
// origin: '*',
methods
:
[
"GET"
,
"POST"
],
methods
:
[
"GET"
,
"POST"
],
// origin: ["http://localhost:7456"],
// origin: ["http://localhost:7456"],
origin
:
[
"https://play.gamee.vn"
,
"https://dev.gamee.vn"
,
"http://localhost:7456"
],
origin
:
[
"https://play.gamee.vn"
,
"https://dev.gamee.vn"
,
"http://localhost:7456"
],
credentials
:
true
,
credentials
:
true
,
}
}
});
});
...
...
src/server.ts
View file @
2ce56318
...
@@ -8,8 +8,9 @@ app.use(express.json());
...
@@ -8,8 +8,9 @@ app.use(express.json());
app
.
get
(
'/'
,
(
req
:
Request
,
res
:
Response
,
next
:
NextFunction
)
=>
{
app
.
get
(
'/'
,
(
req
:
Request
,
res
:
Response
,
next
:
NextFunction
)
=>
{
res
.
send
(
'Hello World'
)
res
.
send
(
'Hello World'
)
})
})
app
.
get
(
'/socket'
,
(
req
:
Request
,
res
:
Response
,
next
:
NextFunction
)
=>
{
res
.
send
(
'socket'
)
// app.get('/socket', (req: Request, res: Response, next: NextFunction) => {
})
// res.send('socket')
// })
export
default
app
;
export
default
app
;
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