Can I deploy a server to Heroku without a client? - heroku

I have built a backend server application without a frontend to it. Can I still deploy it to heroku ?

Sure. Heroku only hosts apps.
As long as your backend server application listens on a specified port, and is able to receive and respond to HTTP requests, you can host it on Heroku.

Related

How to host a website on Heroku without using heroku's own http router?

I need to host a website on Heroku, but I need to have direct access to the HTTP traffic without Heroku's own http router meddling in.
That's not possible.
Heroku doesn't provide a full server infrastruture.
It's rather a limited platform to host HTTP services.

Shopify CLI - How to start a local server without ngrok?

My organization blocks ngrok, so every time I run the Shopify serve command, it fails with a connection error.
So is there any way to just start the Shopify local server? that way I can use cloudfared to tunnel the local server to a subdomain.
When I search on google I found no answer to this question.
I had success running the server without the ngrok.
Here are my steps:
Prepare a cloud server, install Nginx.
config domain settings, and forward the request to your local port.
If you are using a router, only router has a public IP, so you need to forward the request to your pc. You could config it in the router.
then you need to update .env file, update host value
Go partner.shopify.com, app settings. put your URL to the whitelist.
use npm run dev to start your project.
I also set HTTPS in nginx. Due to ngrok server is far away from my location. so after using this way. the starting time is much faster.
Start the server by
npm run dev
instead of,
shopify app serve

Server Client Communcation between heroku apps

I have a server application built on nodejs and socket.io and a client application built with typescript and socket.io.
The two apps are separate git repos.
Can I host them as separate apps on heroku and allow communication between them or do they need to share repo/heroku app?
As heroku allow to open single port per application. You have to use separate heroku apps for:
Nodejs backend which includes socket.io
Front client application which built on Typescript.
You can share share Repo if you're not connected Git with Heroku Repo.
But in case you connected Github repo with Heroku app you need a separate Repo for both.

How can i get http based heroku domain

I created a new heroku nodejs app.
And i received the domain name with HTTPS.
I am using an API where service provider provides only http based requests.
Now the question is can i run heroku app on http?
Your Heroku app will respond to both ports 80 (http) and 443 (https) on the herokuapp.com domain you were given. So if your app is called myapp, you can access it via http://myapp.herokuapp.com and https://myapp.herokuapp.com

How should I communicate with my server on Heroku if I don't know the port?

From what I have understood, Heroku assigns a port every time you deploy. I have an android app that is supposed to communicate with my server that I will deploy to Heroku.
But if I don't know the port, how do I make a POST call?
Does that mean Heroku is not suitable for this application?
I am using Java Spark, if that's relevant.
Your dyno internally uses a random port. Only the heroku router should communicate with that port.
You instead need to use the appname.herokuapp.com subdomain provided with your app, on port 80 or 443.
The router will then automatically forward the request to one of your dynos in random.
So yes, you can use heroku for your android app. Just make requests on the herokuapp.com subdomain like you would do anywhere else.

Resources