I'm having trouble running this in Flask in production. Running on localhost the exact same code works fine. I'm thinking it has to do with a permission issue. How do I make sure that my Flask site can execute the code?
from lndgrpc import LNDClient # for LND rpc
def addInvoice(amount, memo):
INVOICE_MACAROON_FILEPATH = '/home/ekerstein/.lnd/invoice.macaroon'
lnd = LNDClient('127.0.0.1:10009', macaroon_filepath=INVOICE_MACAROON_FILEPATH)
return lnd.add_invoice(amount, memo).payment_request
@app.route("/addinvoice")
def add_invoice():
amount = request.args.get('amount', type = int)
memo = request.args.get('memo', type = str)
return jsonify(addInvoice(amount, memo))
I'm having trouble running this in Flask in production. Running on localhost the exact same code works fine. I'm thinking it has to do with a permission issue. How do I make sure that my Flask site can execute the code?