How Can I Get Heroku to Recognize My Application in my Filesystem? - node.js

I am new to Heroku, and I want to set up my simple Node.js app through Heroku. I have tried following the Heroku docs for setting up node apps, and I have done everything it says to do. Unfortunately I have gotten stuck on the Foreman/Procfile section. I have created a Procfile like the tutorial says (saved as a .txt file), and have put it in the same directory as my source files. When I try to run Foreman, it says "Error: Procfile doesn't exist". It makes some sense, as Heroku doesn't know where my app directory is, but I want to understand how I can fix this. Thanks!

Do not save it as Procfile.txt save it only as Procfile (dot nothing)

Related

Deploying mono repo to Heroku, Node.JS, Angular 9. Heroku CLI

Having a bit of an issue with Heroku. I've always uploaded in one directory, but this time I wanted my folder structure to be a bit more, well structured. The problem is I can't seem to upload to Heroku like this.
I have a directory containing a folder called "client" which contains my angular 9 application and I have a folder called "middle-tier" containing the node.js server application.
I can't figure out how to push this up and allow it to work. The node application serves the angular application.
Everything works locally I just have no idea how to push this up to Heroku servers.
Please see attached screenshots of the structure.
Below is the error message I'm getting. Which I tried to fix by running git init again in the root of the structure. And then running the command to have a node.js build pack. Which was to no avail this also did not work and produced the same problem.
I have tried to include as much detail as I can but if there is anything else I can provide please let me know. I've spent quite some time building my application and am quite eager to deploy it!
Thanks for your time guys!
In short, with multiple discussions with Heroku support line, at the moment it is impossible to upload a mono repo to a single Heroku instance.

How to launch html file (with css and js files included) on remote server on node.js with angular 2

I started working with Angular 2 and have one issue.
I compiled my app for production through "ng build" and got an index.html and other files like js and css in this folder.
I need to publics them on web
Im using remote ubuntu on digital ocean.
I found this nice script, which solved a problem, but to enter a project I need to print in a browser a path like this: somehost:8080/index.html.
Can you help please and explain please, how I can use a path like somehost:8080, or just somehost:8080/index, but without a file extension? I found of course, even simpler scripts, but they dont serve js and css, which are included.
And next question, actually main, is this decision the most elegant to provide an entrance to the app, or there is a better and smarter way? Afterwards, Im thinking about PM2, because all that I need is to launch it like a linux service and to reload the app, if it will be crashed.
Thanks!

Heroku - Application Deploy Error

Many thanks for any help.
Hi all,
like every beginners, i also created some simple app using NodeJs and Angularjs and trying to deploy it on Heroku. really don't know how, read some heroku docs. understand as much as i can. then tried to deploy it. all went very well but finally gives me Application error.
What i did is.!
i clone my own repo from https://github.com/suriyaJaay/Its_Jaay_profile_With_Mr_Mrs_NodeAngular.git
myprojectFolder
public
--app.js
--index.html
LICNCE
server.js
package.json
cmd showed this
any clear guidance?
thanks in advance

Angular 2: NodeJS vs XAMPP

I'm starting to learn Angular 2 and I am quite lost in some subjects... like the server.
Following the instructions for a Quick Setup I installed Node and npm... when I run the project in Node everything goes perfect. The label <label> gets recognized and it gets the template for that label (in this case an html form).
But when I run the same project in MAMP, that label doesn't get recognized and comes out a 'Failed to load resource' error in the console for the template associated to that label.
So I guess Angular 2 is dependent on Node and that's a problem because I want to upload later the project and I think my hosting plan doesn't allow me to run Node...
I don't know if I'm prejudging, maybe anybody can help me clear this... Thanks.
Angular2 has niether any Relation nor any Dependency on node.js.
You can write Angular2 app just using Angular2 packages without using node or mamp or xampp and host that app.
If you have written any thing in Angular2 and node.js combination then you can host it on free services like Heroku for testing purpose.
Final solution:
Ok, wrong again. I'm the worst detective ever.
it works with TypeScript as with JavaScript, just need the "npm start" to compile TypeScript into JavaScript. Then it automatically runs on a "localhost", but once compiled, you can run the index.html like any html, without the need of a server, like you were all saying, it's not like .php which makes all sense.
so the problem that led me to all of this misunderstandings was that the Node "localhost" worked and the Apache "localhost" didn't, and the mistake was that I was calling into #Component: templateUrl: "../template/file.html", and the path is written in "/app/whatever.js", but it's working from "index.html", so it would be just templateUrl: "template/file.html" and everything works as expected.
what I don't know is why it works, with the wrong path, when I run it from Node! an error would have saved me a lot of time... and yours...
Well, at least I have clarified a lot of concepts in this investigation. Thank you all!
Thanks, Zeeshan, in the links you gave me the clue. As I told on my original message, I started following the Quick Start, but I forgot to mention I chose TypeScript over JavaScript... and that was the "mistake", because TypeScript needs Node to compile to JavaScript, as I'm guessing for the results I get:
the TypeScript project only runs after executing it in Node via console ("npm start") and not in Apache, that doesn't get all the Angular part (it gets the tag <whatever></whatever> but doesn't translate it into the content <whatever><h1>Hey</h1></whatever>)
with JavaScript it works "as always", without need of a server, as you were telling me
So I'll have to choose between using TypeScript (and all the official documentation!) and host it in some platform like Heroku or work with JavaScript without needing an specific server so I can still work with Apache.

How can I see which script is being executed by sails lift?

I'm working on a project built by someone else using Sails.js (which is a pretty new technology for me).
The problem I'm having is that for every little change I make to the code I have to restart the server, which is obviously very time consuming. Some articles I read mention the use of forever, which I have installed. The problem I have is that the project I'm working on doesn't have an app.js file in it's root directory.
Following the documentation for Sails and the examples of how to build a test application, I figured there should be an app.js file in the root directory of the project, so I'm kind of confused.
When I run sails lift everything works fine, but I can't figure out how to start my server in a forever fashion.
Thanks.
according to this:
http://sailsjs.org/#/documentation/anatomy/myApp/app.js.html
there should be an app.js, otherwise you cant run it.
On your left hand side there is a filetree, and it shows where it should be located.
Sure it isn't there?
Maybe the app.js file is hidden in the OS? did you try to run it from CLI?
Or try to search the whole directory for sails.lift,i use linux so I would use searchmonkey or something like that

Resources