Commit 680e44ea authored by wty's avatar wty

尝试打出日志

parent b3bda349
...@@ -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()
}) // })
// //
......
...@@ -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 || '3001'); let port = normalizePort(process.env.PORT || '3000');
app.set('port', port); app.set('port', port);
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment