Running a C web dyno in heroku? - c

Purely for fun I've written a tiny http server in C and using the c buildpack listed on the heroku docs, I've got it building a binary in heroku, and I can run it fine via "heroku run ./httpd 52132" It logs to the console "Starting httpd.." etc as expected but I obviously can't access it because thats a worker dyno, not a web dyno so isn't routed to.
My problem comes with I add a Procfile containing "web: ./httpd $PORT" - Heroku says its launched it, heroku ps shows its running but the requests timeout, and the application log never logs any messages from the app (I don't see Starting httpd...)
So in theory its running, but not running.... I'm confused.
As I said, it works when I don't run it via the procfile for web :(!!
Any ideas? (I know this is kind of niche!)
Thanks

Related

Deploying ReactJS app from GitHub to Ubuntu via Actions

My team is working on an NodeJS app with a ReactJS frontend that needs to be deployed on our Ubuntu server. It runs fine locally and it used to run fine on the server until we added a Router/Switch structure into the App.js. Now we get 404 and 502 errors and I'm thinking of adding some GitHub action to automate the deployment process with npm run build and all. Ideally, every time we push to GitHub, the app on the server should update without someone having to tunnel in and type something manually. Can anyone suggest a ready-made YAML file for that purpose? How would we trigger it on our Ubuntu server? Would we run it under nginx (like now) or apache?

app engine deployment through cloud shell hangs without error

I am deploying a app engine application through cloud shell. I have deployed it a lot of times, but currently when ever I deploy it i gets hanged at the below position and nothing happens:
myname#cloudshell:~stackdriver-metrics-export/list_metrics (my-project)$ gcloud app deploy
Services to deploy:
descriptor: [/home/myname/stackdriver-metrics-export/list_metrics/app.yaml]
source: [/home/myname/stackdriver-metrics-export/list_metrics]
target project: [my-project]
target service: [list-metrics]
target version: [20200703t225313]
target url: [http://list-metrics.my-project.uc.r.appspot.com]
Do you want to continue (Y/n)? Y
Beginning deployment of service [list-metrics]...
// it gets stuck here and nothing happens afterwards I even restarted cloudshell lot of times but the same result, there is no change in the cursor position also. No error is also thrown
Please help me as i am new to cloud shell and google cloud.
This is working now, I am not sure what is the reason, but after i try to download a project from cloudshell to my local machine, strangely I found the project in one of the cloud shell directories itself as duplicate, and I have cleaned all of that, so still not sure of the reason
Check if you have symbolic link or very large file in the same directory. That will cause the system to take along time packaging your deployment.

How to make my react app run permanently in ec2?

I made a portfolio website with create react app and I opened an ec2 instance to run my website, when I'm using the ssh command "sudo npm start" afterward the site is running, but when I close down the ssh my website is not online anymore, How can I make my site run indefinitely?
You want to run this as a background service using systemd.
Try taking a look at: https://medium.com/#benmorel/creating-a-linux-service-with-systemd-611b5c8b91d6.

Deploying working react cosmosdb app from local to Azure

So I am new with working with react and have followed this tutorial here to assist me. All runs fine following these videos and all locally, but after doing a npm run build and then pushing to Azure via a local git repo, the UI runs as expected, but whenever the UI tries to hit the Express/Node backend, it gets an error that I am not understanding how to resolve. Looking at the build scripts that runs on both, I do not see where or if I need to change an environment variable as it is already hitting the correct port on Azure. What I get is the following:
What do I need to revise for this? Since webpack with the build script in create-react-app seems to do what it needs to, I am not quite sure where things are going wrong.

Loopback 3 & Angular 2 generation of /reset-password endpoint unrealiable

We are building an application that so far has a simple user management implementation. This question relates to the built-in password resetting functionality of Loopback v3. User management is being worked on a model derived from the built-in User, and it is called MyCustomUser
Each time code changes are pushed into a GitHub repo, we have Jenkins build a Docker container, and inside of it run npm install then lb-sdk (with suitable parameters) then ng build --env=prod and finally node .. After this happens, the application runs normally, BUT:
When performing the same deployment commands locally (on my own linux laptop), the API endpoints /MyCustomUsers/reset and /MyCustomUsers/reset-password are created (i.e. they are visible and manipulable via the Strongloop Explorer)
When the deployment is run by Jenkins in the Docker container, only one of the two API endpoints is created, /MyCustomUsers/reset. God only knows where the other endpoint, /MyCustomUsers/reset-password, ends up.
Obviously, all deployments are run against the same codebase (i.e. the same commit ID of the GitHub repo). It is bewildering how the service behaves perfectly on localhost but not on the cloud-based docker container.
Sounds like you are running two different versions of the Loopback-Angular2-SDK. From what I've understood the SDK for Angular2 is still in heavy beta and not yet ready for production. However this doesn't excuse the difference, but it really sounds like two different versions.
We are using the same build-flow as you, are your package.json identical when it comes to #mean-expert/loopback-sdk-builder?
The guys working with the SDK-generator are really good at responding in their issue-section, would recommend asking there otherwise.
It turns out that the remote docker was running node 6.9.2 and npm 3.10.9, whereas I was running node 6.10.3 and npm 3.10.10. After making the docker instance run the same versions as I had locally and deploying the package.json along with its npm-shrinkwrap.json, the endpoint was correctly generated.

Resources