Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
Dui123
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
王天宇
Dui123
Commits
680e44ea
Commit
680e44ea
authored
Oct 20, 2021
by
wty
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
尝试打出日志
parent
b3bda349
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
19 deletions
+21
-19
app.js
server/app.js
+20
-18
www
server/bin/www
+1
-1
No files found.
server/app.js
View file @
680e44ea
...
@@ -3,6 +3,8 @@ const path = require('path');
...
@@ -3,6 +3,8 @@ const path = require('path');
const
cookieParser
=
require
(
'cookie-parser'
);
const
cookieParser
=
require
(
'cookie-parser'
);
const
logger
=
require
(
'morgan'
);
const
logger
=
require
(
'morgan'
);
const
bodyParser
=
require
(
'body-parser'
)
const
bodyParser
=
require
(
'body-parser'
)
const
engines
=
require
(
'consolidate'
)
const
os
=
require
(
'os'
)
const
indexRouter
=
require
(
'./routes'
);
const
indexRouter
=
require
(
'./routes'
);
const
usersRouter
=
require
(
'./routes/users'
);
const
usersRouter
=
require
(
'./routes/users'
);
...
@@ -12,10 +14,10 @@ const deleteRouter = require('./routes/delete')
...
@@ -12,10 +14,10 @@ const deleteRouter = require('./routes/delete')
const
updateRouter
=
require
(
'./routes/update'
)
const
updateRouter
=
require
(
'./routes/update'
)
const
submitRouter
=
require
(
'./routes/page'
)
const
submitRouter
=
require
(
'./routes/page'
)
const
typeManage
=
require
(
'./routes/typeManage'
)
const
typeManage
=
require
(
'./routes/typeManage'
)
const
engines
=
require
(
'consolidate'
)
const
app
=
express
();
const
app
=
express
();
global
.
domain
=
'http://10.104.83.91:3000/'
console
.
info
(
os
.
networkInterfaces
())
// global.domain = 'http://10.104.83.91:3000/'
// global.domain = 'http://127.0.0.1:3001'
// global.domain = 'http://127.0.0.1:3001'
const
Eureka
=
require
(
'eureka-node'
).
default
const
Eureka
=
require
(
'eureka-node'
).
default
...
@@ -28,22 +30,22 @@ const pkg = require('./package.json')
...
@@ -28,22 +30,22 @@ const pkg = require('./package.json')
// 获取配置的端口号
// 获取配置的端口号
const
port
=
3000
const
port
=
3000
const
dockerApp
=
new
DockerApp
({
//
const dockerApp = new DockerApp({
app
,
//
app,
appType
:
'express'
,
//
appType: 'express',
port
//
port
})
//
})
//
// 注册Eureka
//
//
注册Eureka
global
.
eureka
=
new
Eureka
({
//
global.eureka = new Eureka({
port
,
// 应用端口号
//
port, // 应用端口号
appName
:
'dui123'
,
// 应用名称
//
appName: 'dui123', // 应用名称
services
:
[
'dui123'
]
// 依赖服务名
//
services: ['dui123'] // 依赖服务名
})
//
})
//
global
.
eureka
.
start
().
then
(()
=>
{
//
global.eureka.start().then(() => {
dockerApp
.
startServer
()
//
dockerApp.startServer()
})
//
})
//
//
...
...
server/bin/www
View file @
680e44ea
...
@@ -12,7 +12,7 @@ let http = require('http');
...
@@ -12,7 +12,7 @@ let http = require('http');
* Get port from environment and store in Express.
* Get port from environment and store in Express.
*/
*/
let
port
=
normalizePort
(
process
.
env
.
PORT
||
'300
1
'
);
let
port
=
normalizePort
(
process
.
env
.
PORT
||
'300
0
'
);
app
.
set
(
'port'
,
port
);
app
.
set
(
'port'
,
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