Deploying Node.js on Evennode - node.js

I deployed my node.js app on Evennode using the git command line. On the logs i saw that app was deployed successfully because "db connection successful" is showing on the logs and there are no errors. However, when i try to visit the url it doesn't show any page. I copied the build folder from react to the backend directory so that the node app can read the react build folder from there and render client side. But it seems the app is not able to read the build folder which works fine on heroku but on even node, its not displaying my client side.
I have no idea why it couldn't read my client side build folder so i came to ask to find solutions

Related

Successfully Hosted Nodejs app on render not responding

I have a nodejs app which uses handlebars as templating engine, the app run perfectly fine with no errors on development, and also after hosting it on render the renter's console show status for successful deployment and it's live right now. But the problem is that when ever I make request the site it never respond.
The GitHub repo
While the hosted site's link is here
Render's event logs

How to deploy GitHubPages when it is connected to mongodb atlas?

I have created sample angular application to test GitHubPages deployment..
Backend has a node js code which is connected to MongoDB Atlas.
Frontend has angular which is working fine when starting backend and frontend both.
When I build project, it has fully angular component only.. So I moved to backend into frontend folder and which is now
still when I build and I need to copy paste the database component and dist in one single folder.
If I do that npm install and node index.js it is working fine..
The same i am trying to do in GitHubPages using Actions. until dist folder is fine.. How to move database backend files in to ghPages to up the service. without db files i except html page but showing 404. How to copy db files from master to ghpages branch.
My repository is given https://github.com/changan1111/UserManagement
Any help would be really appreciated.
Github pages can only serve static files (HTML,CSS, js, images, etc.)
It might serve your bundled Angular application, but your API calls will need to be done to a hosted backend.
You can check Google Cloud, AWS, Heroku, Azure for hosting the backend.
Be sure to set CORS properly.

Making my React app working with a Server

I have a question and got confused with the articles I found on the internet.
I have a react App which deploys on the development server. I want to create an admin part, where the administrator will be able to push content into the database. React App will get content from a Database and render it.
Also after the development, I want to upload this on hosting so users from the internet can have access to it and use it. I understand how the server works with post\get requests from glitch projects.
Writing on React.Js, server with express.js
So can someone explain to me the following:
how the server sends React app? Should I send simple index.html with #root div and the whole website will work?
I am a bit confused about how hand-made server and API are different from hostings? How to connect then backend with a hosting?
IN VSCode is it possible to make a react App showing from the server of Node.js? - On glitch I can
sendfile index.html with simple request and I see the landing page.
So theoretically I should have a possibility to send static file through a server of Node.js/Express.js?
Can you explain these questions to me, please or provide some resources where it explained? Currently I'm watching Youtube and Google but how to connect it with my project I do not get a clear idea.
Pretty much. If you use create-react-app to build your React frontend, the build result folder will contain all the static files required (HTML, CSS, JS, images, fonts...). You can then either have your Express app serve it as static data.
"Hosting" is a nebulous term... No, you can't upload a Express/Node.js app to some PHP web hotel and expect it to work. You'll need an application-hosting centered provider/PaaS such as Heroku.
When developing a react + backend app locally, you'd have your backend server running, and the frontend dev server up to serve your frontend and configured to proxy all API requests to the backend server (like this, via the Create-React-App docs).

Deploying Mean Stack Application on Heroku Issue

This is my first time building a MEAN stack application and I built it locally. Now I am trying to host it on heroku and I think I messed it up. I went through different questions here and most of them said both angular and express needs to be in one single app. I din't know that, So here's my current folder structure.
Project Root Folder
|
|
|------ Frontend (Angular App)
|
|
|------- Backend (Express App)
I tried searching everywhere but couldn't figure out what changes I need to make to my current project structure. Any tips or help or even a link to a guide would be much appreciated.
For hosting as a single app
first build the angular app
host the build folder of front end in the backend express app as
app.use('*', express.static('Frontend/build/'))
in start script of backend build the angular app and start the server file(index.js)
inside the server file use port from the environment variables, heroku will automatically assign you with an port which will be pointed to the dynamos url
you acn also follow this article

Steam Web API via Node.js on my shared hosting

Basically, what I'm trying to do is have the Steam Web API running via Node.js on my shared hosting so I can display Steam user profile information on my site. Unfortunately, I'm having a lot of trouble getting it working. I've been following this guide.
This is what I followed to get NodeJS running.
I have it set up like so:
Node.js version - 9.11.2
Application mode - Production
Application root - /home/<name>/nodejs/steamapi-server
Application URL - <mysite.com>/steamapi-server
Application startup file - server.js
My server.js file (minus my API key).
My package.json file.
All dependencies are installed and the script is running.
However, when I go to /steamapi-server all I get is: Cannot GET /steamapi-server/ whereas I would normally be seeing "Hello, World!".
I tested this all locally beforehand and it was working.
Turns out I needed to change app.get('/' to app.get('/steamapi-server'
Now it's working.

Resources