Deploy front-end angular app at with json-server Cloud9 - angularjs

I'm new to web development and just finished Angular course at Coursera.
Everything was OK to my course project app until I have decided to deploy it at Cloud9. So the app doesn't have back-end and takes data from a simple db.json file which I was running on my computer with the json-server at localhost:3000.
I have cloned my git repo to the Cloud9, installed all dependencies and thought that the procedure with json-server will be the same and it will serve json data at the server, but it's looking that I was wrong.
I think I missed something and asking for explanation of my problem.
Thank you guys.

If you're looking to develop on Cloud9, you'll need to make sure you use process.env.IP instead of localhost and process.env.PORT (or port 8080) instead of 3000.
That being said, Cloud9 is not a hosting solution. If you use it as such, your account will be deactivated. Consider something like Heroku for deployment.

Related

Deploy SvelteKit/Pocketbase app to Linode server

I have created sveltekit/pocketbase project that I would like to deploy to Linode to run under subdomains:
backend.mydomain.com for pocketbase
appname.mydomain.com for sveltekit
First I deployed pocketbase and I'm running it with systemd service which is working fine.
But there's problem when I want to deploy and run sveltekit app. I was following this article on how to run svelte app on linode using pm2 and caddy. But there's problem because 443 address is already in use. When I turn off the pocketbase.service I can run my svelte app.
Now I know I should probably use reverse proxy for pocketbase, but I'm new in this and a bit lost in all the information. Any tips on how could I achieve this?

Heroku Client and Server ReactJS deploy

I didn't find any good answer to my problem here on how to deploy a ReactJS App to Heroku when I have to different folders (client and server) that both need a npm start so that my Website works. Structure of folders is as below:
Can anyone give me a clear way how to solve this?

How do I prepare a CRA app to deploy to heroku, do I still have to build as for a fullstack CRA app?

I have a simple create-react-app app that I want to deploy to heroku but I'm not sure about the right wat to deplay or what files exactly. Do I need to npm run build as in the case of a mern fullstack app? I repeat, this is only react, no server. Thank you.
Instead of using Heroku to deploy just the React part, no server, you can use other easier solutions like:
Netlify and Vercel.
What you need need to do that, is just have a GitHub/GitLab repository, register on the platform, choose your repository and wait :)
It will automatically build and serve your React application.
Another cool thing is: Any new commit will generate a new build, so your app will be always updated.

How to set up my Ubuntu nodeJS server, and upload my angularJS WebSites

Does somebody know how to set up propertly websites based on angular (auto generated with yeoman) on ubuntu server?
Here is the thing, I have a project developed in angular, I generated it with yeoman (the basic example, on yeoman codelab). I can run it and see it working on my computer with "grunt serve", but I have no idea how to upload it to my server for access it from the internet.
On my ubuntu, I have installed apache2, MySQL, PHPMyAdmin, and Node (i guess I do not need apache2 for all this, but I have it anyway).
I connect with putty and the command node works fine, npm works fine too.
I am searching info, but I only found how to run a service on the node (example:node test.js) but this is not the case.
But what I want to do is to upload a website (angular) for access it from the internet...
I uploaded the "app" folder (that has the index.html, styles, controllers, views, etc) of my angular website (generated with yeoman), i uploaded it on my www directory in ubuntu, but when I access angular, or styles doesn´t work.
So, the question is: Does NODE have a "www" directory (like in apache2) where I have to upload my websites (angular websites) for access it from the internet? or I have to run it with some kind of "grunt" or "node" command?
Because i can´t run it with "node index.html", and if i access it from the internet it doesn´t work either, so... what am I doing wrong?
If you have a runnable app on local then follow these steps:
Set it up on git and host on github, bitbucket or any other git hosting and connect your server via ssh and choose/make whatever directory. (Doesnt matter which direcory, I personally prefer /var/www )
Pull that repo in that directory.
Run the app using forever or some process management tool like pm2
PS: grunt is more of a developer tool than production tool. so start your app directly using node wahtever_your_server_file_is.js in forever
Also make sure whatever port you are using to run the app is open on your server.

Angular JS, Git and Non-Heroku Deployment

I have Ruby on Rails as my primary programming language and the workflow mostly went as make changes-commit changes-push changes-deploy with capistrano
I looked over the internet for ways to have such a workflow (or at least quite similar) for Angular.JS and I can't seem to find one. There is Yeoman but I can only see examples for Heroku. I host with Webfaction right now.
So I was wondering is there some way to track an angular JS project with Git (preferably Github) then deploy it to Webfaction from that git repo?
Thanks in advance!
I use yeoman to setup angular.js apps and capistrano to deploy them on production (digitalocean) - I wrote an article about this: http://howwedoapps.com/2014/04/03/deploy-angularjs-app-with-capistrano-on-the-cloud. I hope it helps.
I don't know anything about Webfaction, but if it's a VPS you have take a look at Dokku.
It's basically your own Heroku, hosted on your own server.
While it's not specificaly git based, capistrano is one of the most popular ways of deploying ruby web application to a vps. It has features that would allow you to deploy from github, but that would need to be configured separately and would need to be called from the command line from your development computer.

Resources