mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-22 07:36:01 +00:00
dotenv config in dbgate-serve
This commit is contained in:
@@ -95,7 +95,12 @@ function start() {
|
|||||||
|
|
||||||
if (platformInfo.isNpmDist) {
|
if (platformInfo.isNpmDist) {
|
||||||
app.use(getExpressPath('/'), express.static(path.join(__dirname, '../../dbgate-web/public')));
|
app.use(getExpressPath('/'), express.static(path.join(__dirname, '../../dbgate-web/public')));
|
||||||
getPort({ port: 5000 }).then(port => {
|
getPort({
|
||||||
|
port: parseInt(
|
||||||
|
// @ts-ignore
|
||||||
|
process.env.PORT || 3000
|
||||||
|
),
|
||||||
|
}).then(port => {
|
||||||
server.listen(port, () => {
|
server.listen(port, () => {
|
||||||
console.log(`DbGate API listening on port ${port}`);
|
console.log(`DbGate API listening on port ${port}`);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
require('dotenv').config();
|
||||||
|
|
||||||
global.dbgateApiModulePath = path.dirname(path.dirname(require.resolve('dbgate-api')));
|
global.dbgateApiModulePath = path.dirname(path.dirname(require.resolve('dbgate-api')));
|
||||||
global.dbgateApiPackagedPluginsPath = path.dirname(global.dbgateApiModulePath);
|
global.dbgateApiPackagedPluginsPath = path.dirname(global.dbgateApiModulePath);
|
||||||
|
|||||||
@@ -19,13 +19,14 @@
|
|||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"dbgate-api": "^4.1.1",
|
"dbgate-api": "^4.1.1",
|
||||||
"dbgate-web": "^4.1.1",
|
|
||||||
"dbgate-plugin-csv": "^4.1.1",
|
"dbgate-plugin-csv": "^4.1.1",
|
||||||
"dbgate-plugin-xml": "^4.1.1",
|
|
||||||
"dbgate-plugin-excel": "^4.1.1",
|
"dbgate-plugin-excel": "^4.1.1",
|
||||||
"dbgate-plugin-mongo": "^4.1.1",
|
"dbgate-plugin-mongo": "^4.1.1",
|
||||||
"dbgate-plugin-mysql": "^4.1.1",
|
|
||||||
"dbgate-plugin-mssql": "^4.1.1",
|
"dbgate-plugin-mssql": "^4.1.1",
|
||||||
"dbgate-plugin-postgres": "^4.1.1"
|
"dbgate-plugin-mysql": "^4.1.1",
|
||||||
|
"dbgate-plugin-postgres": "^4.1.1",
|
||||||
|
"dbgate-plugin-xml": "^4.1.1",
|
||||||
|
"dbgate-web": "^4.1.1",
|
||||||
|
"dotenv": "^16.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
10
yarn.lock
10
yarn.lock
@@ -3189,6 +3189,11 @@ dbgate-plugin-tools@^1.0.4, dbgate-plugin-tools@^1.0.7:
|
|||||||
pacote "^11.1.13"
|
pacote "^11.1.13"
|
||||||
rimraf "^3.0.2"
|
rimraf "^3.0.2"
|
||||||
|
|
||||||
|
dbgate-plugin-xml@^4.1.1:
|
||||||
|
version "4.7.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/dbgate-plugin-xml/-/dbgate-plugin-xml-4.7.2.tgz#4a1817a7fc3b1ac5191e45dc7b1016b2f97c3158"
|
||||||
|
integrity sha512-LA52/Wg+blaRp/H+v4ypT+l6kbi4sYsTD/JdPaTbfwErMXhGZew9wtDolvbDjKZZ/zfRig0TDXj9fhLILw2cGw==
|
||||||
|
|
||||||
debug@2.6.9, debug@^2.2.0, debug@^2.3.3:
|
debug@2.6.9, debug@^2.2.0, debug@^2.3.3:
|
||||||
version "2.6.9"
|
version "2.6.9"
|
||||||
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
|
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
|
||||||
@@ -3466,6 +3471,11 @@ dot-prop@^4.1.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
is-obj "^1.0.0"
|
is-obj "^1.0.0"
|
||||||
|
|
||||||
|
dotenv@^16.0.0:
|
||||||
|
version "16.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.0.0.tgz#c619001253be89ebb638d027b609c75c26e47411"
|
||||||
|
integrity sha512-qD9WU0MPM4SWLPJy/r2Be+2WgQj8plChsyrCNQzW/0WjvcJQiKQJ9mH3ZgB3fxbUUxgc/11ZJ0Fi5KiimWGz2Q==
|
||||||
|
|
||||||
duplexer2@~0.0.2:
|
duplexer2@~0.0.2:
|
||||||
version "0.0.2"
|
version "0.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.0.2.tgz#c614dcf67e2fb14995a91711e5a617e8a60a31db"
|
resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.0.2.tgz#c614dcf67e2fb14995a91711e5a617e8a60a31db"
|
||||||
|
|||||||
Reference in New Issue
Block a user