Commit 59ac9426 by lixinming

pkg打包所需目录为根目录

parent db9a1f92
{
"name": "gameserver",
"name": "screen",
"version": "1.0.0",
"description": "",
"main": "main.ts",
......@@ -28,6 +28,17 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
"author": "cjj",
"license": "ISC",
"bin": "./out/main.js",
"pkg": {
"scripts":"out/**/*.js",
"assets": [
"public/**/*",
"res/**/*",
"images/**/*",
"video/**/*"
],
"outputPath": "dist"
}
}
......@@ -26,7 +26,8 @@ let serverIp = "";
const ConfigName = "serverConfig.xml";
export async function initConfig() {
try {
let buff = fs.readFileSync(path.join(__dirname.substring(0,__dirname.indexOf("out")), ConfigName));
let buff = fs.readFileSync(path.join('./', ConfigName));
// let buff = fs.readFileSync(path.join(__dirname.substring(0,__dirname.indexOf("out")), ConfigName));
let configStr = buff.toString();
let configInfo:any = await analysisXml(configStr);
if (!configInfo || !configInfo.config) console.log("xml中无配置加载");
......
......@@ -29,7 +29,8 @@ export class httpServer {
httpServer.use(express.static(path.join(__dirname, "../../images")) );
httpServer.use(express.static(path.join(__dirname, "../../video")) );
// httpServer.use(express.static(path.join(__dirname, "../../video")) );
httpServer.use(express.static("./video" ) );
httpServer.use(bodyParser.json({limit:"10kb"}));
httpServer.use(compression())
......
......@@ -10,7 +10,8 @@ export const systemLogPath = {
}
//日志根目录
let baseLogPath = path.resolve(__dirname.substring(0, __dirname.indexOf("out")), 'logs');
// let baseLogPath = path.resolve(__dirname.substring(0, __dirname.indexOf("out")), 'logs');
let baseLogPath = path.resolve('./', 'logs');
let errFile = path.resolve(baseLogPath, systemLogPath.errorLogDir, systemLogPath.errorLogFile);
let handFile =path.resolve(baseLogPath, systemLogPath.handleLogDir, systemLogPath.handleLogFile);
let config = {
......
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