template的修正
This commit is contained in:
parent
9bb1e7c31f
commit
ab29b1736f
|
|
@ -35,8 +35,8 @@ function packageJsonContent({ name, version, description, cliVersion, cliName, c
|
|||
"build:web": "${cliBinName} build --target web --mode production",
|
||||
"build-analyze:web": "${cliBinName} build --target web --mode production --analyze",
|
||||
"build": "tsc",
|
||||
"server:init": "cross-env NODE_ENV=development; cross-env OAK_PLATFORM=server ts-node scripts/initServer.ts",
|
||||
"server:start": "cross-env NODE_ENV=development; cross-env OAK_PLATFORM=server ts-node scripts/startServer.ts",
|
||||
"server:init": "cross-env NODE_ENV=development; cross-env OAK_PLATFORM=server ts-node scripts/initServer.js",
|
||||
"server:start": "cross-env NODE_ENV=development; cross-env OAK_PLATFORM=server ts-node scripts/startServer.js",
|
||||
"postinstall": "npm run make:domain"
|
||||
},
|
||||
"keywords": [],
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ export function packageJsonContent({
|
|||
"build:web": "${cliBinName} build --target web --mode production",
|
||||
"build-analyze:web": "${cliBinName} build --target web --mode production --analyze",
|
||||
"build": "tsc",
|
||||
"server:init": "cross-env NODE_ENV=development; cross-env OAK_PLATFORM=server ts-node scripts/initServer.ts",
|
||||
"server:start": "cross-env NODE_ENV=development; cross-env OAK_PLATFORM=server ts-node scripts/startServer.ts",
|
||||
"server:init": "cross-env NODE_ENV=development; cross-env OAK_PLATFORM=server ts-node scripts/initServer.js",
|
||||
"server:start": "cross-env NODE_ENV=development; cross-env OAK_PLATFORM=server ts-node scripts/startServer.js",
|
||||
"postinstall": "npm run make:domain"
|
||||
},
|
||||
"keywords": [],
|
||||
|
|
|
|||
|
|
@ -0,0 +1,12 @@
|
|||
const { initialize } = require('oak-cli/lib/server/initialize');
|
||||
const { BackendRuntimeContext } = require('../src/context/BackendRuntimeContext');
|
||||
|
||||
const pwd = process.cwd();
|
||||
|
||||
const dropIfExists = process.argv[2];
|
||||
// console.log(dropIfExists);
|
||||
|
||||
initialize(pwd, BackendRuntimeContext.FromSerializedString, !!dropIfExists)
|
||||
.then(
|
||||
() => process.exit(0)
|
||||
);
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
import { initialize } from 'oak-cli/lib/server/initialize';
|
||||
import { BackendRuntimeContext } from '../src/context/BackendRuntimeContext';
|
||||
import mysqlConfig from '../configuration/mysql.json';
|
||||
|
||||
const pwd = process.cwd();
|
||||
|
||||
const dropIfExists = process.argv[2];
|
||||
console.log(dropIfExists);
|
||||
|
||||
initialize(pwd, BackendRuntimeContext.FromSerializedString, mysqlConfig as any, !!dropIfExists)
|
||||
.then(
|
||||
() => process.exit(0)
|
||||
);
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
const { startup } = require('oak-cli/src/server/start');
|
||||
const { BackendRuntimeContext } = require('../src/context/BackendRuntimeContext');
|
||||
const { makeException } = require('../src/types/Exception');
|
||||
const { SimpleConnector } = require('oak-domain/lib/utils/SimpleConnector');
|
||||
const pwd = process.cwd();
|
||||
|
||||
const connector = new SimpleConnector('', makeException, BackendRuntimeContext.FromSerializedString);
|
||||
startup(pwd, BackendRuntimeContext.FromSerializedString, connector);
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
import { startup } from 'oak-cli/lib/server/start';
|
||||
import { BackendRuntimeContext } from '../src/context/BackendRuntimeContext';
|
||||
import { makeException } from '../src/types/Exception';
|
||||
import { SimpleConnector } from 'oak-domain/lib/utils/SimpleConnector';
|
||||
const pwd = process.cwd();
|
||||
|
||||
const connector = new SimpleConnector('', makeException, BackendRuntimeContext.FromSerializedString);
|
||||
startup(pwd, BackendRuntimeContext.FromSerializedString, connector);
|
||||
|
|
@ -33,12 +33,12 @@ export default function initialize(
|
|||
process.env.NODE_ENV === 'development' ? '3001' : '/oak-api'; // 生产环境通过路径映射增加oak-api
|
||||
const protocol =
|
||||
process.env.NODE_ENV === 'development' ? 'http://' : 'https://';
|
||||
URL = `${protocol}${url}${apiPath}/aspect`;
|
||||
URL = `${protocol}${url}${apiPath}`;
|
||||
} else if (process.env.NODE_ENV === 'development') {
|
||||
URL = 'http://localhost:3001/aspect';
|
||||
URL = 'http://localhost:3001';
|
||||
} else {
|
||||
// web和public环境只需要传相对路径
|
||||
URL = `/oak-api/aspect`;
|
||||
URL = `/oak-api`;
|
||||
}
|
||||
const connector = new SimpleConnector(
|
||||
URL,
|
||||
|
|
|
|||
Loading…
Reference in New Issue