How to deploy Express app with Vue Frontend in Vercel? - node.js

I built the Vue app into a folder named dist.
I have backend APIs which are written in Node Express.
When I deploy it on Vercel, I'm getting 404 errors.
Here is my app structure & Vercel settings.
I'm new to Vercel, any help would be appreciated.
App Structure
package.json
vercel.json
Vercel Settings
Vercel Error:

Related

Appp Deployment Processs (Heroku, Angular, NodeJS)

I'm running a MEAN stack webapp on Heroku. I have two folders at root level, "frontend" and "backend". Each folder has their own package.json. I have built the Angular app and put it in the "backend/public" folder. I can serve the Angular app from Express and deploy it to Heroku, no problem.
And here is my doubt: the Angular code in the frontend folder has its own dependencies, but when I build the app, run it on Express, or deploy it to Heroku, is it still using those dependencies from the node_modules folder in the frontend folder? Or are these dependencies somehow injected into the built Angular app's minimized code sent to the backend/public folder, for example?
I'm having trouble finding any info on this specific doubt.

Deploy React JS frontend from Node JS backend with MS Azure

I have deployed my backend express server to feed data to my React frontend app using Heroku. I used the following script to launch my frontend with heroku
"heroku-postbuild": "cd client && npm install && npm run build"
How can I do the same with MS Azure or Firebase? What type of server/hosting can handle this? I am brand new to full stack development so anything helps.
Similar question: How to connect and deploy React app with Node js backend?
file setup
scripts

How do I deploy NodeJS server that's for a React Native App to Heroku?

I have an app using React Native as its frontend, and NodeJS as backend, and it also has a cloud MySQL instance. I want to deploy the app to the public and show it to someone as demo using Heroku or maybe other hosting services.
I want to publish my React Native App with Expo, but am not sure how/ where to host my nodeJS server so that the mobile app can access it.
Steps for deploying React native/expo app to heroku:
1: set heroku buildpack as static: >heroku buildpacks:set heroku-community/static
2: Add static.json for static buildtype: { "root": "web-build/", "routes": { "/**": "index.html" } } More settings here: https://github.com/heroku/heroku-buildpack-static#configuration
3: npm run build (package.json: "build": "expo build:web") --> Creates web-build folder
git add .
git commit
git push heroku master
heroku open
You can follow Heroku official document to deploy your NodeJS server.
https://devcenter.heroku.com/articles/deploying-nodejs
Then you can access the domain provided by Heroku just exactly like on your localhost.

Cannot GET / error with node/express/react project on AWS Elastic Beanstalk

I'm trying to deploy a node application with aws via Elastic Beanstalk. The deployment is showing as successful, but when opening the webpage I receive the error message Cannot GET /.
My general project structure looks like this:
client/
server.js
Where client/ is a react application built using create-react-app and server.js is where express app.listen is defined.
I connected the frontend to the backend in the development environment using "proxy": "http://localhost:5000" in the react app's package.json.
I also added "homepage": "my-aws-url.com/client" to the react package.json since it isn't stored at the root level of the project.
Do I need to do something with the proxy in production similar to what was done in the development environment, or are there other things I'm missing?

buildpack error deploying node.js app to heroku - files seem to be at the correct level>?

I am getting an error in the screen shot bellow deploying a node.js app on heroku saying that the buildpack was unable to detect a node.js codebase
I set the build pack, the package.json is at the root level as is the app.js file
https://www.dropbox.com/s/y1bg6eir2w93m8a/Screenshot%202020-05-29%2013.44.36.png?dl=0
Not sure what I am doing wrong - thanks!!
The error is clear:
A Node.js app on Heroku requires a package.json.
In the files listed below, you can see that the package.json file is missing. You have to commit it and repush your code to Heroku.

Resources