Mean app login not working on heroku - javascript

I have followed many tutorials on how to get mongodb and MEAN to work on heroku, and none of them have worked for me, I keep getting the 503 application error.
First I create the app, I do heroku addons:docs mongolab in the commandline, and after that I check my config and change my code so the mongoose connection is changed to the config string like this:
mongoose.connect(process.env.MONGOLAB_URI || mongodb://example:example#ds053312.mongolab.com:53312/todolist');
the second part is just an example, the one I use is the one with my information.
So after this I push my app to heroku, but when I try to run it, it still gives me the application error, and in f12 it says it's
Failed to load resource: the server responded with a status of 503
(Service Unavailable)
https://myapp.herokuapp.com/favicon.ico
What am I doing wrong? I have tried everything and none of the tutorials are working for me
EDIT: I have managed to get rid of the error by doing the following:
$ git init
$ git add .
$ git commit -m "initial version"
$ heroku apps:create
however, now that my app loads, it appears that the login and sign up features of my app doesn't work, I fill out the sign in/log in form and submit but the page just stays where it is without changing. Is there something else I was supposed to do to get these features to work?

I came here because my Heroku - deploy Login wasn't working, but Localhost was. Turns out I forgot to change the Login POST route.

Related

Next Auth TypeError: Invalid URL

I keep receiving when I run my project - Nextjs. I think it about Next Auth, but don't actually know what to do. I am using version 4.3.1
Need help with next-auth
I have tried changing my next-auth version but no. Yet when I deployed in vercel, it went through
If you don't have NEXTAUTH_URL set in your .env file you will get this error. However vercel will work as next-auth automatically sets it when deployed to vercel.
https://next-auth.js.org/configuration/options#nextauth_url
If you do have NEXTAUTH_URL set then my best guess is the url is wrong in some way. Maybe missing http://?

Laravel Vuejs Uncaught (in promise) ChunkLoadError: Loading chunk blogs-component failed

I have a Laravel + Vuejs project and while everything works fine on local development, 2 pages are throwing the ChunkLoadError.
I have looked at other issues on SO, and checked my output path, file is really there.
Page is here : https://dev.trouveruncouvreur.ca/guide-toiture and same for https://dev.trouveruncouvreur.ca/city/d-soumission-couvreur-toiture-Brossard
Error is here :
The chunk is available if you click on the link https://dev.trouveruncouvreur.ca/js/blogs-component.js
Edit: I deleted the project from the dev server, and reinstalled everything without success. I keep having the same issue. I did install on another server I have access to, and the error is gone, pages are all served correctly. We just found out client on dev server is using Cloudflare, so once we have acces, we can delete cache and see how it goes.
In this case, Cloudflare's cache was the culprid. All vues files/chunk are now correctly served.

Heroku Logs Not Loading

In my Heroku dashboard or on my command, when I try to open my logs i get a 503 Service Unavailable and I can't file a support ticket because I am using a free account. Does anyone know why this would be happening? The Heroku status monitor also says that Heroku services are all good https://status.heroku.com/. My app is also currently running and it does not seem to be affected. I am pretty sure this is an issue with Heroku but I can't get any support due to being a free account.

Node.JS: Why is my connection to localhost:3000 refused?

I'm a student going into back-end development for the first time and are trying to learn Node.JS. I downloaded a pdf book about Node.JS from sitepoint called: "Jumpstart Node.JS". In following the instructions to set up the server on the command line, install the dependencies, and navigate to localhost:3000, i got nothing except the following message: "Connection refused: localhost:3000", Can somebody please tell me what might have went wrong and how to fix it?
Edit1:
The instructions i followed is about setting up a node.js server using the Node command line, thus no code, simply cmd commands, however, here is a quick summary of the process i followed:
Created an account on MongoLabs and then a database using the free pricing plan.
Installed express using the command: npm install -g express#.2.5.8.
Created an applications with default options using this command: express authentication.
modified the package.json file in system32
installed the dependencies by typing cd authentication, hitting enter, and then typing the command: npm install
Typed node app and hit enter.
According to the instructions i should have seen a message: "Welcome to express" but instead got the error message.
In following the instructions to set up the server on the command line, install the dependencies, and navigate to localhost:3000
It seems that you didn't start the server.
Somewhere between installing the dependencies and navigating to the URL you need to actually start the server if you want it to serve the request.
Check that there is no copy of the server running in the background, or that another app is using the port currently.
(Your firewall show allow you to see which app has been allocated to that port)
Because nodejs requires it to be the only app on that port running on your computer.
Also try a different port maybe?

Meteor not being able to connect to prerender.io server

I have set up a prerender server on my local machine.
It is on port 3033 and it seems to display a rendered version of my meteor site when I type this in
curl http://localhost:3033/http://localhost:3000/?_escaped_fragment_=
Knowing that my prerender site works, I'm trying to set it up so that if I go to
curl http://localhost:3000/?_escaped_fragment_=
it should give me my Meteor site.
I'm using this package (https://github.com/dfischer/meteor-prerenderio) and I've got this line in my settings.json file
"PrerenderIO": {
"prerenderServiceUrl": "http://localhost:3033/"
}
However, when I run
curl http://localhost:3000/?_escaped_fragment_=
it returns nothing and I'm getting this message shown up on my meteor server log
res.send(status, body): Use res.status(status).send(body) instead
and it doesn't seem to be hitting the prerender server.
What is this message and why aren't I able to hit the prerender server?

Categories

Resources