chore: adjust parameters

This commit is contained in:
chenos 2021-03-22 13:33:57 +08:00
parent 6c76d27cd3
commit b95e2da129
9 changed files with 19922 additions and 9 deletions

View File

@ -14,7 +14,7 @@ DB_LOG_SQL=
DB_MYSQL_PORT=3306
DB_POSTGRES_PORT=5432
HTTP_PORT=23000
API_PORT=23000
VERDACCIO_PORT=4873

1
.gitignore vendored
View File

@ -5,6 +5,7 @@ lib/
package-lock.json
yarn.lock
!/yarn.lock
!/package-lock.json
yarn-error.log
lerna-debug.log
packages/database/package-lock.json

19912
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -11,7 +11,7 @@ DB_PASSWORD=test
DB_MYSQL_PORT=3306
DB_POSTGRES_PORT=5432
HTTP_PORT=23000
API_PORT=23000
VERDACCIO_PORT=4873

View File

@ -7,11 +7,11 @@ export default defineConfig({
},
define: {
'process.env.API': `/api`,
// 'process.env.API': `http://localhost:${process.env.HTTP_PORT}/api`,
// 'process.env.API': `http://localhost:${process.env.API_PORT}/api`,
},
proxy: {
'/api': {
'target': `http://localhost:${process.env.HTTP_PORT}/`,
'target': `http://localhost:${process.env.API_PORT}/`,
'changeOrigin': true,
'pathRewrite': { '^/api' : '/api' },
},

View File

@ -81,7 +81,7 @@ api.resourcer.use(async (ctx: actions.Context, next) => {
name: 'users',
}});
await api.database.getModel('automations').load();
api.listen(process.env.HTTP_PORT, () => {
console.log(`http://localhost:${process.env.HTTP_PORT}/`);
api.listen(process.env.API_PORT, () => {
console.log(`http://localhost:${process.env.API_PORT}/`);
});
})();

View File

@ -1,4 +1,4 @@
HTTP_PORT=23000
API_PORT=23000
DB_DATABASE=test
DB_USER=test

View File

@ -4,7 +4,7 @@ import qs from 'qs';
import { FILE_FIELD_NAME, STORAGE_TYPE_LOCAL } from '../constants';
import { getApp, getAgent, getAPI } from '.';
const DEFAULT_LOCAL_BASE_URL = process.env.LOCAL_STORAGE_BASE_URL || `http://localhost:${process.env.HTTP_PORT}/uploads`;
const DEFAULT_LOCAL_BASE_URL = process.env.LOCAL_STORAGE_BASE_URL || `http://localhost:${process.env.API_PORT}/uploads`;
describe('action', () => {
let app;

View File

@ -45,7 +45,7 @@ export function middleware(app) {
url = {
protocol: 'http:',
hostname: 'localhost',
port: process.env.HTTP_PORT,
port: process.env.API_PORT,
pathname: baseUrl
};
}