zavodil / near-api-server

12 stars 22 forks source link

Basic Question #10

Open inventionarts opened 3 years ago

inventionarts commented 3 years ago

Hi. Fairly new to this form of development, and I have a basic question I'm hoping you can answer, Zavodil.

the file near-api-server.config.json contains this code: { "server_host": "localhost", "server_port": 3000, "rpc_node": "https://rpc.testnet.near.org", "init_disabled": true }

What should I set localhost and port: 3000 to when deploying to, say, azure. Azure uses this scheme for addressing a web app: .azurewebsites.net - presumably this goes where localhost is? And the port, I am not clear on. Just leave at 3000?

Thanks in advance.

Ron

zavodil commented 3 years ago

Hey! Try to set to server ip and it will became accessible on YOUR_IP:3000 or YOUR_HOST.azurewebsites.net:3000

inventionarts commented 3 years ago

Ah, okay. So will try this. Also noticed this in the Azure docs for deploying node apps:

Be sure that your application is listening on the port provided by the PORT environment variable: process.env.PORT. Think that might be an issue? And any idea where I would "be sure the app is listening" to this PORT environment variable? Would that be some code or assignment of whatever process.env.PORT returns to "server_port": 3000 do you think?

Thanks again.

{ "server_host": "https://nearAPI3.azurewebsites.net", "server_port": 3000, "rpc_node": "https://rpc.testnet.near.org", "allow_rpc_update": false }

inventionarts commented 3 years ago

Ah, didn't work. Still getting Application Error. I wonder if server_port needs to be set to whatever that process.env.PORT setting produces on Azure. If you think another approach to deployment might be better, great. I'm adept at so-called NoCode development, particularly using Bubble.io.

What I'm trying to accomplish is access and control over NFT minting, transfer, and account setup/login via the Bubble API Connector, which is similar to Postman. I can talk to this API with Postman when it's localhost, but Bubble cannot hit the local server, and anyway, that is not a way to get this all live. Thanks!