DEV Community

Hosting an App with Heroku and Netlify (if you've never done it before)

Linda Thompson on November 19, 2018

Over the past 7 months, I've been hard at work on the Google / Udacity Mobile Web Specialist scholarship program. It's been an intense, and rewardi...
Collapse
 
heggy231 profile image
Heggy Castaneda • Edited

Deploy failed in Netlify. When I visit Netlify page, this is an error message. Page Not found
Looks like you've followed a broken link or entered a URL that doesn't exist on this site.

[Update] It is up and running on Netlify!!! First, I moved the files to root directory and got rid of the dist folder since I don't need to compile code (no grunt). Thank you!

Collapse
 
lindakatcodes profile image
Linda Thompson

So glad you got it working, Heggy! :)

Collapse
 
jeffchavez_dev profile image
Jeff Chavez • Edited

Hi,
I got this error. I already updated the port to not to listen to the local host but I am still getting this.

dev-to-uploads.s3.amazonaws.com/i/...

Collapse
 
lindakatcodes profile image
Linda Thompson

Hi Jeff - Did you check what your log said, the one mentioned in that error message? What's it telling you?

Collapse
 
jeffchavez_dev profile image
Jeff Chavez

I tried to correct the error on the port and updated it and this is now what I got on the logs:

-----> Building on the Heroku-20 stack
-----> Node.js app detected

----------> Creating runtime environment

   NPM_CONFIG_LOGLEVEL=error
   NODE_VERBOSE=false
   NODE_ENV=production
   NODE_MODULES_CACHE=true
Enter fullscreen mode Exit fullscreen mode

----------> Installing binaries
engines.node (package.json): unspecified
engines.npm (package.json): unspecified (use default)

   Resolving node version 12.x...
   Downloading and installing node 12.20.1...
   Using default npm version: 6.14.10
Enter fullscreen mode Exit fullscreen mode

----------> Installing dependencies
Installing node modules
added 53 packages in 1.052s

----------> Build

----------> Caching build
- node_modules

----------> Pruning devDependencies
audited 53 packages in 0.841s

   1 package is looking for funding
     run `npm fund` for details

   found 0 vulnerabilities
Enter fullscreen mode Exit fullscreen mode

----------> Build succeeded!
! This app may not specify any way to start a node process
devcenter.heroku.com/articles/node...
----------> Discovering process types
Procfile declares types -> (none)
Default types for buildpack -> web
----------> Compressing...
Done: 22.8M
----------> Launching...
Released v3
twitter0282.herokuapp.com/ deployed to Heroku

Collapse
 
jeffchavez_dev profile image
Jeff Chavez

Hi, thanks for the reply. Here's what I got:

dev-to-uploads.s3.amazonaws.com/i/...

Thread Thread
 
lindakatcodes profile image
Linda Thompson

So your project might vary - my server project doesn't have a start command that Heroku deals with. It just needs access to the GitHub repo.

This error looks like it can't find a start command. That'll be in your package.json file if it exists. If it's there, you might try running npm run start - the run command is necessary for most npm scripts, though sometimes start will work without it.

Hope that helps! From your other comment, it looks like your build succeeded, so hopefully you're able to move forward!

Thread Thread
 
jeffchavez_dev profile image
Jeff Chavez

Cool! I'll try that

Thread Thread
 
jeffchavez_dev profile image
Jeff Chavez

Still not working. Hmmm.

Thread Thread
 
lindakatcodes profile image
Linda Thompson

Sorry I can't be of more help! Keep searching and troubleshooting, I'm sure you'll get it figured out!

Thread Thread
 
jeffchavez_dev profile image
Jeff Chavez

Thank you so much!

Collapse
 
nickhiebertdev profile image
Nick Hiebert

Thanks for sharing your experience with Netlify and Heroku!

I'm in the process of tasting different cloud hosting platforms to learn how these work. From just recently finished the React for Beginners course, I have some small app ideas for improving my workflow, tools that don't currently exist and building portfolio assets.

Both of these solutions sound quite simple. Great post!

I always like connecting with other developers online, if you're interested please give me a follow if you think the content I post is valuable to you:

Twitter Instagram Website

Collapse
 
scrabill profile image
Shannon Crabill

I had never used Netflify or Heroku before today. Thanks to your tutorial, I was able to host my restaurant reviews app within 30 minutes! I had been putting off hosting this project for people to interact with...I didn't realize it could be this easy!

Collapse
 
lindakatcodes profile image
Linda Thompson

I'm so glad it helped, Shannon! That's awesome. :)

Collapse
 
anishjana profile image
anishjana

Hi Linda,

Thank you for the thorough blog.

However I am facing an issue. I am making an API call to an URL from my node.js, which is hosted on Heroku. I am expected to get a JSON response. However the logs show permission denied to the URL with 403 status.

I have even set Access-control allow Origin: * but in vain.

Can you help me !

Collapse
 
lindakatcodes profile image
Linda Thompson

Hi anishjana -

Do you have your code somewhere so I can look at it? That sounds like something is definitely stopping it from being able to connect, but without seeing anything it's hard to say what might be causing it. I'll be happy to help if I can!

Collapse
 
anaknickerbocker profile image
Ana Knickerbocker

This post really helped me, thanks Linda!

Collapse
 
jekkiboi profile image
Jack Mayer

Hello! New coder here. I am not using gulp but I noticed that you said you "changed a few localhost calls" to your herokuapp url and I realized that I had quite a few in my client side code. I am not sure how to use the heroku url since the call says:
const url = 'localhost:4000/api/cities';
How do I route to /api/cities but also use "/api/cities"?

I really hope that made sense (I'm so new to all this). And thanks for posting!
Jack

Collapse
 
satyaki07 profile image
Satyaki Bose

backend server(deployed on Heroku) is not working in Netlify, but in local dev server it is working. Please help.