commit
3a8716a1f0
2 changed files with 8 additions and 5 deletions
|
|
@ -1,7 +1,8 @@
|
||||||
|
const Path = require("path");
|
||||||
const grpc = require("grpc");
|
const grpc = require("grpc");
|
||||||
const protoLoader = require("@grpc/proto-loader");
|
const protoLoader = require("@grpc/proto-loader");
|
||||||
const fs = require("../../utils/fs");
|
|
||||||
const logger = require("winston");
|
const logger = require("winston");
|
||||||
|
const fs = require("../../utils/fs");
|
||||||
const errorConstants = require("../../constants/errors");
|
const errorConstants = require("../../constants/errors");
|
||||||
|
|
||||||
// expose the routes to our app with module.exports
|
// expose the routes to our app with module.exports
|
||||||
|
|
@ -42,7 +43,7 @@ module.exports = async ({
|
||||||
enums: String,
|
enums: String,
|
||||||
defaults: true,
|
defaults: true,
|
||||||
oneofs: true,
|
oneofs: true,
|
||||||
includeDirs: ["node_modules/google-proto-files", "proto"]
|
includeDirs: ["node_modules/google-proto-files", "proto", Path.resolve(__dirname, "../../config")]
|
||||||
}
|
}
|
||||||
|
|
||||||
const [lnrpcProto, routerProto, walletUnlockerProto] = await Promise.all([protoLoader.load(lnrpcProtoPath, protoLoaderConfig), protoLoader.load(routerProtoPath, protoLoaderConfig), protoLoader.load(walletUnlockerProtoPath, protoLoaderConfig)]);
|
const [lnrpcProto, routerProto, walletUnlockerProto] = await Promise.all([protoLoader.load(lnrpcProtoPath, protoLoaderConfig), protoLoader.load(routerProtoPath, protoLoaderConfig), protoLoader.load(walletUnlockerProtoPath, protoLoaderConfig)]);
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ const server = program => {
|
||||||
|
|
||||||
// load app default configuration data
|
// load app default configuration data
|
||||||
const defaults = require('../config/defaults')(program.mainnet)
|
const defaults = require('../config/defaults')(program.mainnet)
|
||||||
const rootFolder = process.resourcesPath || __dirname
|
const rootFolder = program.rootPath || process.resourcesPath || __dirname
|
||||||
|
|
||||||
// define env variables
|
// define env variables
|
||||||
Dotenv.config()
|
Dotenv.config()
|
||||||
|
|
@ -212,12 +212,14 @@ const server = program => {
|
||||||
})
|
})
|
||||||
|
|
||||||
app.use((req, res, next) => {
|
app.use((req, res, next) => {
|
||||||
res.set('Version', program.version())
|
res.set('Version', program.version ? program.version() : 'N/A')
|
||||||
next()
|
next()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const storageDirectory = Path.resolve(rootFolder, `${program.rootPath ? '.' : '..'}/.storage`);
|
||||||
|
|
||||||
await Storage.init({
|
await Storage.init({
|
||||||
dir: Path.resolve(rootFolder, '../.storage')
|
dir: storageDirectory
|
||||||
})
|
})
|
||||||
|
|
||||||
const getSessionSecret = async () => {
|
const getSessionSecret = async () => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue