What server is react boilerplate using "under the hood"? - react-boilerplate

When you start a server on localhost using react boilerplate and type "npm start", what server is actually being used? Apache, nginx?

when you start server using react boilerplate installed from npmjs.org
it will automatically start a server from express framework which runs in port 3000.
You can check your version of express framework used from nodemodules/express/package.json file

Related

Source map not loading when development server is using HTTPS and localhost

I have a development server on HTTPS using a self signed certificate for locahost. App is build using create-react-app and I am starting up the dev server set HTTPS=true&&react-scripts start. Source maps are not loaded in Chrome's developer tools.
When using HTTP source maps shows up correctly. react-scripts version is 2.1.8.

Live rebuild of client side code in JHipster while developing remotely

I'm somewhat new to JHipster and have used grunt in the past to live reload changes to client side code in Tomcat webapps. I'm wondering what best practices are to do the same with JHipster. The documentation discusses using "yarn start" or "npm start" when working on your local machine. I need to work remotely on an AWS box and can't do Browsersync.
As I make changes in the /src tree I'd like them to get picked up and deployed into the /target tree so I'll see them with a browser refresh.
Curious what other have done in this situation and would appreciate any recommendations on how to accelerate JHipster client side development on a remote server.
Thanks!

How to port Angular SPA (using http-server) to Azure WebApp?

I've created an Angular 1.6.x application using Visual Studio Code, with bower'ed dependencies. The Angular app talks to a separate ASP.NET MVC REST/API application for data (eventually with adal-angular).
Locally, I'm using http-server to run the Angular app successfully using npm start:
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "start http://localhost:8080/app/index.html && http-server -a localhost -p 8080"
},
While I've been able to successfully get the Angular source code to my defined App Services on the Azure (verified using the Web App's console option) using the Continuous Delivery mechanism, it's not entirely obvious how the application will start, specifically:
How does Azure know how to do a "npm start"? Where do I instruct this to happen, if it's not automatic?
How would I instruct my application to use process.env.PORT, instead of port 8080?
Assuming I get past this initial issue, are there guidelines for http-server usage on Azure? Or are there other recommended ways to serve Angular SPAs?
FWIW, I note that the trying to run 'npm start' from the Azure console results in an 'ELIFECYCLE' error.
As you deploy your app to Azure WebApp, Azure will use IIS to host your app and only ports 80 and 443 are public-facing. So you don't need any other HTTP server to server your web application on Azure.
You can clarify what issue you ran into when you visited your website, so we can help to figure out what's wrong there.
The Azure Web App model hosts node.js/Angular apps within IIS, therefore a configured web.config file is required. The magic glue between IIS and node is the iisnode module: https://github.com/tjanczuk/iisnode that allows hosting of node.js applications within IIS.
The web.config file can direct IIS to start the app's app.js (or server.js) file, which would include a reference to process.env.PORT.
A good overall guide for deploying node apps is: https://blogs.msdn.microsoft.com/laurelle/2015/12/01/how-to-deploy-a-node-js-site-into-azure-web-app-to-create-a-website/.
The best guideline and documentation I could find on setting up a web.config is here: https://github.com/tjanczuk/iisnode/blob/master/src/samples/configuration/web.config

Configure AngularJS and NodeJS server

Hello i'm trying to develop a restful api using nodejs and express, and i also want to create a client-side application using angularjs. As explained in AngularJS oficial website:
"The angular-phonecat project is configured with a simple static web server for hosting the application during development. Start the web server by running:
npm start
This will create a local webserver that is listening to port 8000 on your local machine. You can now browse to the application at:
http://localhost:8000/app/index.html"
So i should run client side app in node web server. but my restful api also run in my node web server. How should i set up node js to be able to run both instances of nodejs at the same time and be able to conect to my restful api from my angularjs application
If your app is structured like angular-phonecat, open your package.json file and find where the npm start command is configured (hint: "scripts" > "start") and change the port that http-server is using.
i.e. "http-server -a 0.0.0.0 -p new_port_number"

Plug webpack-dev-server and hot-load React with Tomcat

I'm developing inside ecosystem that uses Tomcat server that servers all the files both java and javascript but the I run the javascript first through WebPack.
Is there any way that I can use webpack-dev-server and hot-loader for react/css/javascript files with running Tomcat server on localhost:8080 ?

Resources